From 86867ce6bd4ab564c2de970ca3c3ebb125c74bd9 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Sat, 26 Sep 2026 21:30:38 +0200 Subject: [PATCH] fix: replay search opened before its modal loads, guard lazy icons --- .../lib/components/home/ListFilters.svelte | 4 ++- .../lib/components/icons/appIcon.svelte.ts | 8 ++++- .../src/routes/(root)/(logged)/+layout.svelte | 32 +++++++++++++++---- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/frontend/src/lib/components/home/ListFilters.svelte b/frontend/src/lib/components/home/ListFilters.svelte index b67a634f56..5482c59c42 100644 --- a/frontend/src/lib/components/home/ListFilters.svelte +++ b/frontend/src/lib/components/home/ListFilters.svelte @@ -115,7 +115,9 @@ {:else if resourceType} {@const SvelteComponent = appIconComponent(filter)} - + {#if SvelteComponent} + + {/if} {:else if filter.startsWith('u/')} {:else if filter.startsWith('f/')} diff --git a/frontend/src/lib/components/icons/appIcon.svelte.ts b/frontend/src/lib/components/icons/appIcon.svelte.ts index 956df9e60e..7346a4904e 100644 --- a/frontend/src/lib/components/icons/appIcon.svelte.ts +++ b/frontend/src/lib/components/icons/appIcon.svelte.ts @@ -8,11 +8,17 @@ let icons = $state.raw() let loading: Promise | undefined function load() { - if (!icons) loading ??= import('./index').then((m) => (icons = m)) + if (!icons) + loading ??= import('./index').then( + (m) => (icons = m), + // Cleared so the next read retries rather than keeping the tab icon-less. + () => (loading = undefined) + ) return icons } export function appIconComponent(name: string | undefined): Component | undefined { + if (!name) return undefined return load()?.appIconComponent(name) } diff --git a/frontend/src/routes/(root)/(logged)/+layout.svelte b/frontend/src/routes/(root)/(logged)/+layout.svelte index b65f4f3d92..84600c8649 100644 --- a/frontend/src/routes/(root)/(logged)/+layout.svelte +++ b/frontend/src/routes/(root)/(logged)/+layout.svelte @@ -1,5 +1,6 @@ - +