From dd1c630c71cf99b1c7a7a3179e706146ae61d7d4 Mon Sep 17 00:00:00 2001 From: wukko Date: Mon, 9 Sep 2024 02:30:20 +0600 Subject: [PATCH] web/remux: download files properly --- web/src/routes/remux/+page.svelte | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/web/src/routes/remux/+page.svelte b/web/src/routes/remux/+page.svelte index 5d09dd13..b3360c79 100644 --- a/web/src/routes/remux/+page.svelte +++ b/web/src/routes/remux/+page.svelte @@ -5,9 +5,9 @@ import { beforeNavigate } from "$app/navigation"; import { device } from "$lib/device"; - import { openURL } from "$lib/download"; import { t } from "$lib/i18n/translations"; import { createDialog } from "$lib/dialogs"; + import { downloadFile } from "$lib/download"; import Skeleton from "$components/misc/Skeleton.svelte"; import DropReceiver from "$components/misc/DropReceiver.svelte"; @@ -133,19 +133,13 @@ }); }); - if (render) { - if (device.is.iOS) { - return await navigator.share({ - files: [ - new File([ render ], file.name, { type: render.type }) - ] - }).catch(() => {}); - } - - openURL(URL.createObjectURL(render)); - } else { - console.log("not a valid file"); + if (!render) { + return console.log("not a valid file"); } + + return await downloadFile({ + file, + }) } finally { processing = false; file = undefined;