Skip to content

Commit

Permalink
Don't refetch pinned project list more than we need to
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeseast committed Mar 19, 2024
1 parent c824aff commit 6364e4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/pages/app/sidebar/projects/ProjectList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
}
async function getPinnedList() {
console.log("getPinnedList");
const pinned = (await getProjects(user.id)).filter(
(project) => project.pinned,
);
Expand All @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion src/projects/Browser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down

0 comments on commit 6364e4f

Please sign in to comment.