web/remux: fix file saving on ios
This commit is contained in:
parent
2c75c52eb3
commit
2bcc849790
1 changed files with 9 additions and 0 deletions
|
@ -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");
|
||||||
|
|
Loading…
Reference in a new issue