From 6e2e40387392af54cbb0e8ac5e40b62ec9fc73db Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Fri, 24 Oct 2025 16:01:58 +0700 Subject: [PATCH] Improve pending state with clearer messages --- web/src/lib/components/PendingState.svelte | 21 ++++++++++----- web/src/routes/test/[test]/+page.svelte | 30 ++++++++++++++++++++-- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/web/src/lib/components/PendingState.svelte b/web/src/lib/components/PendingState.svelte index d99f826..e8de208 100644 --- a/web/src/lib/components/PendingState.svelte +++ b/web/src/lib/components/PendingState.svelte @@ -8,9 +8,10 @@ interface Props { test: Test; + fetching?: boolean; } - let { test, nbfetch, nextfetch }: Props = $props(); + let { test, nbfetch, nextfetch, fetching = false }: Props = $props(); let lastForcedCheck = $state(Date.now() - 12345); function forceCheck() { @@ -36,17 +37,23 @@
- {#if nextfetch} + {#if fetching || nextfetch === 0} + Looking for new email... + {:else if nextfetch}
- Next inbox check in {nextfetch} second{#if nextfetch > 1}s{/if}... + + Next inbox check in {nextfetch} second{#if nextfetch > 1}s{/if}... + {#if nbfetch > 0}
{:else if test && test.status !== "analyzed"} - fetchTest()} /> + fetchTest()} + /> {:else if report}
@@ -198,7 +219,12 @@
- +