From ed030ec47762f8b35ad67905057e65839d68cb08 Mon Sep 17 00:00:00 2001 From: jj Date: Sat, 20 Dec 2025 15:21:32 +0000 Subject: [PATCH] web/download: do not show additional dialog on top of dialog in openURL --- web/src/components/dialog/SavingDialog.svelte | 2 +- web/src/lib/download.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/components/dialog/SavingDialog.svelte b/web/src/components/dialog/SavingDialog.svelte index 8a391c8c..6fa1ed49 100644 --- a/web/src/components/dialog/SavingDialog.svelte +++ b/web/src/components/dialog/SavingDialog.svelte @@ -69,7 +69,7 @@ if (file) { return openFile(file); } else if (url) { - return openURL(url); + return openURL(url, true); } }} > diff --git a/web/src/lib/download.ts b/web/src/lib/download.ts index 0bb04510..efcf50ee 100644 --- a/web/src/lib/download.ts +++ b/web/src/lib/download.ts @@ -51,7 +51,7 @@ export const shareFile = async (file: File) => { }); } -export const openURL = (url: string) => { +export const openURL = (url: string, hasDialog = false) => { if (!['http:', 'https:'].includes(new URL(url).protocol)) { return alert('error: invalid url!'); } @@ -59,7 +59,7 @@ export const openURL = (url: string) => { const open = window.open(url, "_blank", "noopener,noreferrer"); /* if new tab got blocked by user agent, show a saving dialog */ - if (!open) { + if (!open && !hasDialog) { return openSavingDialog({ url, body: get(t)("dialog.saving.blocked")