Skip to content

Commit

Permalink
use explicit ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Aug 16, 2024
1 parent b81e397 commit ded5878
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions streamlit_pdf_viewer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ def pdf_viewer(input: Union[str, Path, bytes],
elif resolution_boost > 10:
raise ValueError("ratio_boost must be lower than 10")

if scroll_to_page:
if scroll_to_annotation:
if scroll_to_page is not None:
if scroll_to_annotation is not None:
raise ValueError("scroll_to_page and scroll_to_annotation cannot be used together")
if scroll_to_page and scroll_to_page < 1:
if scroll_to_page is not None and scroll_to_page < 1:
scroll_to_page = None

else:
if scroll_to_annotation and scroll_to_annotation < 1:
if scroll_to_annotation is not None and scroll_to_annotation < 1:
scroll_to_annotation = None

if type(input) is not bytes:
Expand Down

0 comments on commit ded5878

Please sign in to comment.