Cleanup useEffects

This commit is contained in:
2025-01-27 22:39:47 -06:00
parent d16f14cafe
commit 3aabecb513
3 changed files with 4 additions and 18 deletions

View File

@ -175,15 +175,9 @@ export default function InviteCodes() {
}, []);
useEffect(() => {
if (typeof window !== "undefined") {
fetchCodes();
}
fetchCodes();
}, [lastUpdate]);
if (typeof window === "undefined") {
return <div></div>;
}
return (
<div className="card bg-base-100 shadow-xl">
<div className="card-body p-2 sm:p-8">

View File

@ -392,15 +392,11 @@ export default function UserList() {
}
}
if (typeof window !== "undefined") {
checkSettings();
}
checkSettings();
}, [lastUpdate]);
useEffect(() => {
if (typeof window !== "undefined" && hasValidSettings) {
fetchUsers();
}
fetchUsers();
}, [lastUpdate, hasValidSettings]);
useEffect(() => {
@ -409,10 +405,6 @@ export default function UserList() {
};
}, []);
if (typeof window === "undefined") {
return <div></div>;
}
if (!settingsLoaded) {
return (
<div className="card bg-base-100 shadow-xl">