diff --git a/components/GameModManagementModal.tsx b/components/GameModManagementModal.tsx index caaa03f..79f72e6 100644 --- a/components/GameModManagementModal.tsx +++ b/components/GameModManagementModal.tsx @@ -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"); @@ -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", {