Skip to content

Commit ed030ec

Browse files
committed
web/download: do not show additional dialog on top of dialog in openURL
1 parent 0095368 commit ed030ec

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

web/src/components/dialog/SavingDialog.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
if (file) {
7070
return openFile(file);
7171
} else if (url) {
72-
return openURL(url);
72+
return openURL(url, true);
7373
}
7474
}}
7575
>

web/src/lib/download.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ export const shareFile = async (file: File) => {
5151
});
5252
}
5353

54-
export const openURL = (url: string) => {
54+
export const openURL = (url: string, hasDialog = false) => {
5555
if (!['http:', 'https:'].includes(new URL(url).protocol)) {
5656
return alert('error: invalid url!');
5757
}
5858

5959
const open = window.open(url, "_blank", "noopener,noreferrer");
6060

6161
/* if new tab got blocked by user agent, show a saving dialog */
62-
if (!open) {
62+
if (!open && !hasDialog) {
6363
return openSavingDialog({
6464
url,
6565
body: get(t)("dialog.saving.blocked")

0 commit comments

Comments
 (0)