diff --git a/pwa/src/hooks/markdown.ts b/pwa/src/hooks/markdown.ts index 491578845..33c151b8a 100644 --- a/pwa/src/hooks/markdown.ts +++ b/pwa/src/hooks/markdown.ts @@ -7,10 +7,18 @@ export const useMarkdown = () => { const API: APIService | null = React.useContext(APIContext); const getContent = (filePath: string) => - useQuery(["contents", filePath], () => API?.Markdown.getContent(filePath), { + useQuery({ + queryKey: ["contents", filePath], + queryFn: () => API?.Markdown.getContent(filePath), onError: (error) => { console.warn(error.message); }, + refetchOnWindowFocus: false, + refetchOnMount: false, + refetchOnReconnect: false, + retry: 1, + retryDelay: 2000, + staleTime: 1000 * 60 * 60, // one hour }); return { getContent };