mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-05 22:15:36 +05:00
19 lines
556 B
TypeScript
19 lines
556 B
TypeScript
"use client";
|
|
import { useState, useEffect } from "react";
|
|
import { useUserStore } from "../store/auth";
|
|
import { useRouter } from "next/navigation";
|
|
|
|
export const DiscoverPage = () => {
|
|
const token = useUserStore((state) => state.token);
|
|
const authState = useUserStore((state) => state.state);
|
|
const router = useRouter();
|
|
|
|
useEffect(() => {
|
|
if (authState === "finished" && !token) {
|
|
router.push("/login?redirect=/discover");
|
|
}
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, [authState, token]);
|
|
|
|
return <></>;
|
|
};
|