Skip to content

Commit

Permalink
disable revalidateOnFocus
Browse files Browse the repository at this point in the history
  • Loading branch information
g-plane committed Sep 5, 2023
1 parent 2ee5605 commit 5832528
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/components/VersionSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ export default function VersionSelect({ isLoadingSwc }: Props) {
const [swcVersion, setSwcVersion] = useAtom(swcVersionAtom)
const { data: oldSWC, error: errorOfOld } = useSWR(
'@swc/wasm-web',
fetchSwcVersions
fetchSwcVersions,
{ revalidateOnFocus: false }
)
const { data: newSWC, error: errorOfNew } = useSWR(
'@swc/binding_core_wasm',
fetchSwcVersions
fetchSwcVersions,
{ revalidateOnFocus: false }
)
const bg = useBgColor()
const borderColor = useBorderColor()
Expand Down
4 changes: 3 additions & 1 deletion src/components/Workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ const Main = styled.main`
export default function Workspace() {
const { data: monaco } = useSWR('monaco', () => loader.init())
const [swcVersion] = useAtom(swcVersionAtom)
const { data: swc, error } = useSWR(swcVersion, loadSwc)
const { data: swc, error } = useSWR(swcVersion, loadSwc, {
revalidateOnFocus: false,
})
const [code] = useAtom(codeAtom)
const [swcConfig] = useAtom(parsedSwcConfigAtom)
const [fileName] = useAtom(fileNameAtom)
Expand Down

0 comments on commit 5832528

Please sign in to comment.