From 9a910b72e77898726bd9e2d92661cfbdffea3f7b Mon Sep 17 00:00:00 2001 From: Tormak <63308171+Tormak9970@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:25:12 -0400 Subject: [PATCH] fix: error messages no longer show briefly when changing games --- src/components/core/grids/GridResults.svelte | 61 ++++++++++---------- src/components/core/grids/Grids.svelte | 14 +---- 2 files changed, 33 insertions(+), 42 deletions(-) diff --git a/src/components/core/grids/GridResults.svelte b/src/components/core/grids/GridResults.svelte index f0d4637..045dbdb 100644 --- a/src/components/core/grids/GridResults.svelte +++ b/src/components/core/grids/GridResults.svelte @@ -12,7 +12,7 @@ const padding = 20; - export let isLoading: boolean; + let isLoading = true; export let hasCustomName: boolean; let hasMorePages = getHasMorePages($selectedSteamGridGameId, $gridType); @@ -48,22 +48,23 @@ onMount(() => { console.log("mounting grid results..."); - filterGridsOnStateChange(getPageNumberForGame($selectedSteamGridGameId, $gridType), hasCustomName); + filterGridsOnStateChange(getPageNumberForGame($selectedSteamGridGameId, $gridType), hasCustomName).then(() => { + isLoading = false; + }); }); - -{#if $isOnline} - {#if !$needsSGDBAPIKey} - {#if !!$selectedGameAppId} - - {#if isLoading} -
- {#each new Array(100) as _} - - {/each} -
- {:else} + + {#if isLoading} +
+ {#each new Array(100) as _} + + {/each} +
+ {:else} + {#if $isOnline} + {#if !$needsSGDBAPIKey} + {#if !!$selectedGameAppId} {#if grids.length > 0}
{#each grids as grid (`${$selectedSteamGridGameId}|${grid.id}|${$gridType}`)} @@ -75,28 +76,28 @@ No results for {$gridType === GridTypes.HERO ? "Heroe" : $gridType}s for "{$selectedGameName}".
{/if} + {:else} +
+ Select a game to start managing your art! +
{/if} - -
+ {:else} +
+ Please set your API key to use SteamGridDB. +
+ {/if} {:else}
- Select a game to start managing your art! + You're currently offline. In order to go online and access SteamGridDB, try hitting the "Go Online" button below.
{/if} - {:else} -
- Please set your API key to use SteamGridDB. -
{/if} -{:else} -
- You're currently offline. In order to go online and access SteamGridDB, try hitting the "Go Online" button below. -
-{/if} + +