From d297c6310a6a4db8dd7cc3efe6ff59620deadcc0 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Sat, 13 Jul 2024 17:29:33 +0200 Subject: frontend/reader: Show loading indicators Sometimes images may not load fast enough, resulting in the app being seemingly stuck displaying the same sets of images. Use a timeout to detect when images take too long to load and show a spinner instead. --- frontend/.eslintrc.cjs | 3 ++- frontend/src/lib/reader/Reader.svelte | 2 +- frontend/src/lib/reader/ReaderPage.svelte | 35 ++++++++++++++++++++++++++++--- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index c204ebe..352fa79 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -34,7 +34,8 @@ module.exports = { '@typescript-eslint/no-unsafe-assignment': 'off', '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-enum-comparison': 'off', - '@typescript-eslint/no-unsafe-member-access': 'off' + '@typescript-eslint/no-unsafe-member-access': 'off', + 'no-undef': 'off' } }, { diff --git a/frontend/src/lib/reader/Reader.svelte b/frontend/src/lib/reader/Reader.svelte index 0b1450a..a8f9440 100644 --- a/frontend/src/lib/reader/Reader.svelte +++ b/frontend/src/lib/reader/Reader.svelte @@ -24,7 +24,7 @@ {/if}
-
+
{#if $$slots.sidebar} {/if} diff --git a/frontend/src/lib/reader/ReaderPage.svelte b/frontend/src/lib/reader/ReaderPage.svelte index fb3e780..c86414d 100644 --- a/frontend/src/lib/reader/ReaderPage.svelte +++ b/frontend/src/lib/reader/ReaderPage.svelte @@ -1,19 +1,48 @@ -
+
+
+ {#if loading} + + {/if} +
{page.path}
-- cgit v1.2.3-2-gb3c3