diff options
Diffstat (limited to '')
-rw-r--r-- | app/src/lib/svelte/Navigation.svelte | 2 | ||||
-rw-r--r-- | app/src/lib/ts/download.ts | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/app/src/lib/svelte/Navigation.svelte b/app/src/lib/svelte/Navigation.svelte index 973924a..f0535ef 100644 --- a/app/src/lib/svelte/Navigation.svelte +++ b/app/src/lib/svelte/Navigation.svelte @@ -1,7 +1,7 @@ <script lang="ts"> + import { page } from '$app/stores'; import Icon from '@iconify/svelte'; import { AppRail, AppRailAnchor, getDrawerStore } from '@skeletonlabs/skeleton'; - import { page } from '$app/stores'; const drawerStore = getDrawerStore(); diff --git a/app/src/lib/ts/download.ts b/app/src/lib/ts/download.ts index 16712fb..c3e98b0 100644 --- a/app/src/lib/ts/download.ts +++ b/app/src/lib/ts/download.ts @@ -19,10 +19,11 @@ export default async function saveFile(blob: ArrayBuffer, suggestedName: string const writable = await handle.createWritable(); await writable.write(blob); await writable.close(); + return; } catch (err: unknown) { // TypeScript if ((err as Error)?.name !== 'AbortError') { - console.error(err); + return Promise.reject(err); } } } else { @@ -30,5 +31,7 @@ export default async function saveFile(blob: ArrayBuffer, suggestedName: string anchor.download = suggestedName ?? 'truncated'; anchor.href = URL.createObjectURL(new Blob([blob])); anchor.click(); + URL.revokeObjectURL(anchor.href); + document.body.removeChild(anchor); } } |