Skip to content

Commit

Permalink
only load fide data when modal is open
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed Dec 18, 2023
1 parent 9ead173 commit 297a66d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/databases/FideInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function FideInfo({
data: player,
error,
isLoading,
} = useSWR(fileExists ? name : null, async (name) => {
} = useSWR((!fileExists || !opened) ? null : name, async (name) => {
const res = await commands.findFidePlayer(name);
if (res.status === "ok") {
return res.data;
Expand Down

0 comments on commit 297a66d

Please sign in to comment.