revert to original useSWR
This commit is contained in:
parent
ae8ada58ca
commit
4c7b27a886
|
@ -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 (
|
||||
|
|
|
@ -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') {
|
||||
|
|
Loading…
Reference in a new issue