|
|
|
@@ -1,5 +1,6 @@ |
|
|
|
import { Box } from "@mui/material"; |
|
|
|
import { PageID } from "codes/page"; |
|
|
|
import useAuth from "hooks/useAuth"; |
|
|
|
import useNavigateCustom from "hooks/useNavigateCustom"; |
|
|
|
import { useEffect } from "react"; |
|
|
|
import { getPath } from "routes/path"; |
|
|
|
@@ -7,9 +8,15 @@ import { StoreId, getStore } from "storage/localstorage"; |
|
|
|
|
|
|
|
export default function Page404() { |
|
|
|
const { navigateWhenChanged } = useNavigateCustom(); |
|
|
|
const { authenticated } = useAuth(); |
|
|
|
|
|
|
|
// ログインページにアクセス経験ある場合は、ログインページへ遷移させる |
|
|
|
useEffect(() => { |
|
|
|
if (authenticated) { |
|
|
|
navigateWhenChanged(getPath(PageID.DASHBOARD_OVERVIEW)); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
const canLoginRoute = !!getStore(StoreId.LOGIN_ROUTE); |
|
|
|
|
|
|
|
if (canLoginRoute) { |
|
|
|
|