From 6364e4f0f0a695564fca9077b2f0355eb5bbbbfb Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Tue, 19 Mar 2024 13:26:20 -0400 Subject: [PATCH] Don't refetch pinned project list more than we need to --- src/pages/app/sidebar/projects/ProjectList.svelte | 4 +--- src/projects/Browser.svelte | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pages/app/sidebar/projects/ProjectList.svelte b/src/pages/app/sidebar/projects/ProjectList.svelte index 10b1109c5..53fb4a77a 100644 --- a/src/pages/app/sidebar/projects/ProjectList.svelte +++ b/src/pages/app/sidebar/projects/ProjectList.svelte @@ -28,6 +28,7 @@ } async function getPinnedList() { + console.log("getPinnedList"); const pinned = (await getProjects(user.id)).filter( (project) => project.pinned, ); @@ -36,9 +37,6 @@ if (!equal($pinStore, pinned)) $pinStore = sortPins(pinned); } - // when the pinstore changes, refetch the list - $: $pinStore, getPinnedList(); - // fetch the list on mount onMount(async () => { await getPinnedList(); diff --git a/src/projects/Browser.svelte b/src/projects/Browser.svelte index 2454b7726..1b050b2b0 100644 --- a/src/projects/Browser.svelte +++ b/src/projects/Browser.svelte @@ -16,7 +16,7 @@ import { getProjects, getPublicProjects } from "../api/project"; import type { User } from "../api/types"; import { getMe } from "../api/orgAndUser"; - import Filters, { FilterKey, filter } from "./Filters.svelte"; + import Filters, { type FilterKey, filter } from "./Filters.svelte"; let drawer: Drawer; @@ -42,6 +42,7 @@ $: items = res.results; export async function load(filter: FilterKey, cursor?: string) { + console.log("Loading: %s", filter); loading = true; try { user = await getMe();