Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Only load data on modal open
  • Loading branch information
regalijan committed Nov 8, 2023
1 parent 513bd58 commit d2b5de1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/GameModManagementModal.tsx
Expand Up @@ -25,6 +25,8 @@ export default function (props: { isOpen: boolean; onClose: () => void }) {
const toast = useToast();

useEffect(() => {
if (!props.isOpen) return;

(async function () {
const gmeResp = await fetch("/api/gme/list");

Expand All @@ -40,7 +42,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) {

setMods(await gmeResp.json());
})();
}, []);
}, [props.isOpen]);

async function addUser(user: string) {
const addResp = await fetch("/api/gme/add", {
Expand Down

0 comments on commit d2b5de1

Please sign in to comment.