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 fetchNotices = useNoticesStore((state) => state.fetchNotices);
// useEffect(() => {
// setIsReady(true);
// }, []);
useEffect(() => {
setIsReady(true);
}, []);
// useEffect(() => {
// if (isReady && !token) {
// router.replace("/login");
// }
// }, [isReady, token, router]);
useEffect(() => {
if (isReady && !token) {
router.replace("/login");
}
}, [isReady, token, router]);
useEffect(() => {
if (token) {

View File

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