fix: redirection from index page

This commit is contained in:
Dakshesh Jain 2022-11-25 13:06:34 +05:30
parent db14e9735e
commit 09e5e631b6
3 changed files with 5 additions and 3 deletions

View file

@ -10,7 +10,9 @@ const Home: NextPage = () => {
const { user, isUserLoading, activeWorkspace, workspaces } = useUser();
if (!isUserLoading && !user) router.push("/signin");
useEffect(() => {
if (!isUserLoading && (!user || user === null)) router.push("/signin");
}, [isUserLoading, user, router]);
useEffect(() => {
if (!activeWorkspace && workspaces?.length === 0) router.push("/invitations");