revert to original useSWR

This commit is contained in:
spencerwooo 2021-08-23 16:26:04 +01:00
parent ae8ada58ca
commit 4c7b27a886
No known key found for this signature in database
GPG key ID: 24CD550268849CA0
2 changed files with 2 additions and 11 deletions

View file

@ -109,9 +109,7 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) =
const path = queryToPath(query)
const { data, error } = useSWR(`/api?path=${path}`, fetcher, {
revalidateOnFocus: false,
})
const { data, error } = useSWR(`/api?path=${path}`, fetcher)
if (error) {
return (

View file

@ -17,14 +17,7 @@ import DownloadBtn from '../DownloadBtn'
const fetcher = (url: string) => axios.get(url).then(res => res.data)
const MarkdownPreview: FunctionComponent<{ file: any; standalone?: boolean }> = ({ file, standalone = true }) => {
const { data, error } = useSWR(file['@microsoft.graph.downloadUrl'], fetcher, {
revalidateOnFocus: false,
revalidateOnMount: false,
revalidateOnReconnect: false,
refreshWhenOffline: false,
refreshWhenHidden: false,
refreshInterval: 0,
})
const { data, error } = useSWR(file['@microsoft.graph.downloadUrl'], fetcher)
useEffect(() => {
if (typeof window !== 'undefined') {