chore(site): enable react-query cache (#11113)

This commit is contained in:
Bruno Quaresma
2023-12-08 23:58:29 +00:00
committed by GitHub
parent d8e95001e8
commit 8488afa8df
-6
View File
@@ -14,17 +14,11 @@ import {
} from "@mui/material/styles";
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
const shouldEnableCache =
window.location.hostname.includes("dev.coder.com") ||
process.env.NODE_ENV === "development";
const defaultQueryClient = new QueryClient({
defaultOptions: {
queries: {
retry: false,
refetchOnWindowFocus: false,
cacheTime: shouldEnableCache ? undefined : 0,
networkMode: shouldEnableCache ? undefined : "offlineFirst",
},
},
});