From 2b8d32f3c982e68151683d0d70390dfa89b49b77 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Fri, 12 Jul 2024 15:26:51 +0100 Subject: [PATCH] blockLoading of near to me card until stores have been read --- src/lib/cards/NearToMeCard.svelte | 34 ++++++++++++++++++------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/lib/cards/NearToMeCard.svelte b/src/lib/cards/NearToMeCard.svelte index 65a44df..36e71ab 100644 --- a/src/lib/cards/NearToMeCard.svelte +++ b/src/lib/cards/NearToMeCard.svelte @@ -15,6 +15,7 @@ let errorMessage: string; let stations: NearestStationResponse[] = []; + let blockLoading: boolean = true; let config: CardConfig = { title: "Near to Me", @@ -58,28 +59,33 @@ getNearestStations(); } } + blockLoading = false; }); - {#if !$uuid || $uuid === "null"} - - {:else if $location} - {#if !stations.length} - {#if errorMessage} -

{errorMessage}

+ {#if blockLoading} + + {:else} + {#if !$uuid || $uuid === "null"} + + {:else if $location} + {#if !stations.length} + {#if errorMessage} +

{errorMessage}

+ {:else} + + {/if} {:else} - +
+ {#each stations as station} + + {/each} +
{/if} {:else} -
- {#each stations as station} - - {/each} -
+ {/if} - {:else} - {/if}