mały fix odnośnie błędu na starcie aplikacji
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ export function UserSection({ notices, title }) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
fetchUsers();
|
if (token) {
|
||||||
|
fetchUsers();
|
||||||
|
}
|
||||||
}, [token]);
|
}, [token]);
|
||||||
|
|
||||||
const usersWithNoticeCount =
|
const usersWithNoticeCount =
|
||||||
|
|||||||
Reference in New Issue
Block a user