Clear the query cache when the signed-in account changes

Logging out or switching accounts kept the previous user's React Query
cache (follows, feed, cloud, e621 pages), so the new account briefly
saw the old one's followed tags/pools until each query refetched. The
query client now lives in lib/queryClient.ts and login/register/logout
clear it alongside the e621 credential store.
This commit is contained in:
2026-09-17 14:41:56 -05:00
parent 62561a13f3
commit e95dc5f265
3 changed files with 21 additions and 12 deletions
+2 -12
View File
@@ -1,21 +1,11 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { QueryClientProvider } from "@tanstack/react-query";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
import App from "./App";
import "./index.css";
const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: 1,
staleTime: 30_000,
gcTime: 30 * 60_000,
refetchOnWindowFocus: false,
},
},
});
import { queryClient } from "@/lib/queryClient";
createRoot(document.getElementById("root")!).render(
<StrictMode>