diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 1dcbf80..a6ff450 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -6,9 +6,9 @@ let files: FileList | null; let url: string = ''; - let urlInput: HTMLInputElement; let fileForm: HTMLFormElement; let hasFile = true; + let loading = false; $: if (files && files.length >= 0) { hasFile = true; @@ -44,6 +44,7 @@ const summarize = async () => { try { + loading = true; let result; if (hasFile) { if (!files) throw new Error('File missing'); @@ -53,6 +54,7 @@ result = await submitUrl(url); } summary.set(JSON.stringify(result.response)); + loading = false; return goto('chat'); } catch (error) { alert((error as App.Error).message); @@ -63,43 +65,46 @@
Enter the URL you'd like to have summarized.
-•
-Or you can submit a text file instead:
- -Please wait while Sumi tries to make sense of this garbage.
+ {:else} +Enter the URL you'd like to have summarized.
+•
+Or you can submit a text file instead:
+ +