Skip to content

Commit

Permalink
fix: Handle TimeoutError in can_launch_url func call
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Jan 29, 2025
1 parent 186c631 commit 179ec48
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hoyo_buddy/web_app/pages/finish.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,12 @@ async def add_accounts_to_db(self, e: ft.ControlEvent) -> None:

# Redirect to Discord
url = get_discord_protocol_url(channel_id=channel_id, guild_id=guild_id)
if page.can_launch_url(url):
try:
can_launch = page.can_launch_url(url)
except TimeoutError:
can_launch = False

if can_launch:
page.launch_url(url, web_window_name=ft.UrlTarget.SELF.value)
else:
url = get_discord_url(channel_id=channel_id, guild_id=guild_id)
Expand Down

0 comments on commit 179ec48

Please sign in to comment.