From 485ac26c30bbb85c4d61f06ab51a420fcf5daff4 Mon Sep 17 00:00:00 2001 From: madkarmaa Date: Fri, 9 May 2025 11:40:34 +0200 Subject: [PATCH] refactor: better banner logic --- src/lib/components/organisms/NavBar.svelte | 30 ++++++++++++++-------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/lib/components/organisms/NavBar.svelte b/src/lib/components/organisms/NavBar.svelte index b5205f3..004fb91 100644 --- a/src/lib/components/organisms/NavBar.svelte +++ b/src/lib/components/organisms/NavBar.svelte @@ -4,13 +4,23 @@ import api from '$api'; -{#await api.general.ping() then apiUp} - {#if !apiUp} - - The API is currently unresponsive and some services may not work correctly. - {#await api.general.getAbout() then data} - Check the for updates. - {/await} - - {/if} -{/await} + +{#snippet apiDownBanner()} + + The API is currently unresponsive and some services may not work correctly. + {#await api.general.getAbout() then data} + Check the for updates. + {/await} + +{/snippet} + +