From b9a2e9d954f7df85bd0f5b242217a0dcf32bd581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Fri, 2 Sep 2022 10:37:56 +0200 Subject: [PATCH] Show loading indicators after a delay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prevents from loading indicators flickering for a split second during a page draw. For requests that take longer than 200ms we show the loading animation. Signed-off-by: Rūdolfs Ošiņš --- src/Loading.svelte | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/src/Loading.svelte b/src/Loading.svelte index c557bdab1..73957a3e5 100644 --- a/src/Loading.svelte +++ b/src/Loading.svelte @@ -1,10 +1,22 @@ -
-
-
- {#if !condensed} -
-
- {/if} +{#if show} +
+
+
+ {#if !condensed} +
+
+ {/if} +
-
+{/if}