diff --git a/src/routes/(app)/(library)/+page.svelte b/src/routes/(app)/(library)/+page.svelte index 36044806..a799483f 100644 --- a/src/routes/(app)/(library)/+page.svelte +++ b/src/routes/(app)/(library)/+page.svelte @@ -50,12 +50,16 @@ nextFetchPolicy: 'cache-only' }); - if ($tab === null) { + $: if ($tab === null) { categories.subscribe((e) => { - $tab = e.data?.categories?.nodes.find((ele) => ele.default)?.id ?? 0; + window.requestAnimationFrame(() => { + tab.set(e.data?.categories?.nodes.find((ele) => ele.default && ele.id !== 0)?.id ?? 0); + }); }); } + $: console.log($tab); + $: orderedCategories = [...($categories.data?.categories?.nodes ?? [])] .toSorted((a, b) => { return a.order > b.order ? 1 : -1;