refactor(client): optimize suspense components

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2026-01-01 10:38:57 +08:00
committed by Asai Neko
parent 4c438cf4e4
commit b5b4bb9d66
7 changed files with 99 additions and 34 deletions

View File

@@ -4,7 +4,24 @@ import { ThemeProvider } from '@/components/theme-provider';
import { Toaster } from '@/components/ui/sonner';
import '@/index.css';
const queryClient = new QueryClient();
const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: (failureCount, error: any) => {
// eslint-disable-next-line ts/no-unsafe-assignment
const status
// eslint-disable-next-line ts/no-unsafe-member-access
= error?.response?.status ?? error?.status;
if (status >= 400 && status < 500) {
return false;
}
return failureCount < 3;
},
},
},
});
function RootLayout() {
return (