Cleanup useEffects
All checks were successful
Docker Deploy / build-and-push (push) Successful in 1m5s

This commit is contained in:
Atridad Lahiji 2025-01-27 22:39:47 -06:00
parent d16f14cafe
commit 3aabecb513
Signed by: atridad
SSH key fingerprint: SHA256:LGomp8Opq0jz+7kbwNcdfTcuaLRb5Nh0k5AchDDb438
3 changed files with 4 additions and 18 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "pdsmanager", "name": "pdsmanager",
"type": "module", "type": "module",
"version": "0.3.4", "version": "0.3.5",
"scripts": { "scripts": {
"dev": "astro dev", "dev": "astro dev",
"build": "astro build", "build": "astro build",

View file

@ -175,15 +175,9 @@ export default function InviteCodes() {
}, []); }, []);
useEffect(() => { useEffect(() => {
if (typeof window !== "undefined") { fetchCodes();
fetchCodes();
}
}, [lastUpdate]); }, [lastUpdate]);
if (typeof window === "undefined") {
return <div></div>;
}
return ( return (
<div className="card bg-base-100 shadow-xl"> <div className="card bg-base-100 shadow-xl">
<div className="card-body p-2 sm:p-8"> <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]); }, [lastUpdate]);
useEffect(() => { useEffect(() => {
if (typeof window !== "undefined" && hasValidSettings) { fetchUsers();
fetchUsers();
}
}, [lastUpdate, hasValidSettings]); }, [lastUpdate, hasValidSettings]);
useEffect(() => { useEffect(() => {
@ -409,10 +405,6 @@ export default function UserList() {
}; };
}, []); }, []);
if (typeof window === "undefined") {
return <div></div>;
}
if (!settingsLoaded) { if (!settingsLoaded) {
return ( return (
<div className="card bg-base-100 shadow-xl"> <div className="card bg-base-100 shadow-xl">