mały fix odnośnie błędu na starcie aplikacji

This commit is contained in:
2025-06-12 10:13:20 +02:00
parent 0790285ae5
commit 945d225a9f
2 changed files with 11 additions and 9 deletions

View File

@@ -15,15 +15,15 @@ export default function Home() {
const [isReady, setIsReady] = useState(false); const [isReady, setIsReady] = useState(false);
const fetchNotices = useNoticesStore((state) => state.fetchNotices); const fetchNotices = useNoticesStore((state) => state.fetchNotices);
// useEffect(() => { useEffect(() => {
// setIsReady(true); setIsReady(true);
// }, []); }, []);
// useEffect(() => { useEffect(() => {
// if (isReady && !token) { if (isReady && !token) {
// router.replace("/login"); router.replace("/login");
// } }
// }, [isReady, token, router]); }, [isReady, token, router]);
useEffect(() => { useEffect(() => {
if (token) { if (token) {

View File

@@ -20,7 +20,9 @@ export function UserSection({ notices, title }) {
} }
}; };
if (token) {
fetchUsers(); fetchUsers();
}
}, [token]); }, [token]);
const usersWithNoticeCount = const usersWithNoticeCount =