web/remux: fix file saving on ios

This commit is contained in:
dumbmoron 2024-09-08 18:59:51 +00:00
parent 2c75c52eb3
commit 2bcc849790
No known key found for this signature in database

View file

@ -4,6 +4,7 @@
import { browser } from "$app/environment"; import { browser } from "$app/environment";
import { beforeNavigate } from "$app/navigation"; import { beforeNavigate } from "$app/navigation";
import { device } from "$lib/device";
import { openURL } from "$lib/download"; import { openURL } from "$lib/download";
import { t } from "$lib/i18n/translations"; import { t } from "$lib/i18n/translations";
import { createDialog } from "$lib/dialogs"; import { createDialog } from "$lib/dialogs";
@ -133,6 +134,14 @@
}); });
if (render) { if (render) {
if (device.is.iOS) {
return await navigator.share({
files: [
new File([ render ], file.name, { type: render.type })
]
}).catch(() => {});
}
openURL(URL.createObjectURL(render)); openURL(URL.createObjectURL(render));
} else { } else {
console.log("not a valid file"); console.log("not a valid file");