web/download: do not show additional dialog on top of dialog in openURL
Some checks failed
Run tests / check lockfile correctness (push) Has been cancelled
Run tests / web sanity check (push) Has been cancelled
Run tests / api sanity check (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled

This commit is contained in:
jj
2025-12-20 15:21:32 +00:00
parent 0095368856
commit ed030ec477
2 changed files with 3 additions and 3 deletions

View File

@@ -69,7 +69,7 @@
if (file) {
return openFile(file);
} else if (url) {
return openURL(url);
return openURL(url, true);
}
}}
>

View File

@@ -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")