diff options
author | Matt Strapp <matt@mattstrapp.net> | 2023-09-28 10:17:11 -0500 |
---|---|---|
committer | Matt Strapp <matt@mattstrapp.net> | 2023-09-28 10:17:11 -0500 |
commit | 536df17c2e170f562e3c908f97f5a0579fdc69da (patch) | |
tree | eb41d5f7ed9d400470c633c08d75ce2fef6d9efe /app/src/lib | |
parent | Make the website less ugly, especially on mobile (diff) | |
download | trinkets-536df17c2e170f562e3c908f97f5a0579fdc69da.tar trinkets-536df17c2e170f562e3c908f97f5a0579fdc69da.tar.gz trinkets-536df17c2e170f562e3c908f97f5a0579fdc69da.tar.bz2 trinkets-536df17c2e170f562e3c908f97f5a0579fdc69da.tar.lz trinkets-536df17c2e170f562e3c908f97f5a0579fdc69da.tar.xz trinkets-536df17c2e170f562e3c908f97f5a0579fdc69da.tar.zst trinkets-536df17c2e170f562e3c908f97f5a0579fdc69da.zip |
Make everything look better again
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to 'app/src/lib')
-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); } } |