Skip to content

Open source CapCut alternative.

TypeScript

fix(site): the sidebar keeps what it read while a project is open

David Le39a866d09340
diff --git a/site/src/queries/QueryProvider.tsx b/site/src/queries/QueryProvider.tsx
index ced2d7f9..5f5bab89 100644
--- a/site/src/queries/QueryProvider.tsx
+++ b/site/src/queries/QueryProvider.tsx
@@ -9,6 +9,13 @@ export function QueryProvider({ children }: { children: ReactNode }) {
new QueryClient({
defaultOptions: {
queries: {
+ // Every query here is one account-scoped listing under a fixed
+ // key — the sidebar's surfaces, the projects and library shelves,
+ // the account row — so the whole set is small and bounded. Holding
+ // it for the life of the tab is what makes a surface that unmounts
+ // (the sidebar, while a project is open) paint its last answer the
+ // moment it comes back, with the fresh read landing behind it.
+ gcTime: Infinity,
refetchOnWindowFocus: false,
retry: 1,
staleTime: 30_000,