From 9ff0a88a7998abfe183eb28681f6517432bafa27 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 10 Apr 2025 15:00:26 +0200 Subject: [PATCH] use $derived.by --- .../collection-[collection]/subNavigation.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/subNavigation.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/subNavigation.svelte index 52ff26534..60fb843ac 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/subNavigation.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/subNavigation.svelte @@ -19,11 +19,11 @@ let databaseId = $derived(page.params.database); let collectionId = $derived(page.params.collection); - const sortedCollections = $derived(() => + const sortedCollections = $derived.by(() => data?.allCollections?.collections?.slice().sort((a, b) => a.name.localeCompare(b.name)) ); - const selectedCollection = $derived(() => + const selectedCollection = $derived.by(() => sortedCollections()?.find((collection) => collection.$id === collectionId) ); @@ -49,7 +49,7 @@
{#if data?.allCollections?.total}