diff options
Diffstat (limited to 'frontend/app/components/PublicOnlyRoute.tsx')
| -rw-r--r-- | frontend/app/components/PublicOnlyRoute.tsx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/frontend/app/components/PublicOnlyRoute.tsx b/frontend/app/components/PublicOnlyRoute.tsx index 7b3ef9d..e28f5ee 100644 --- a/frontend/app/components/PublicOnlyRoute.tsx +++ b/frontend/app/components/PublicOnlyRoute.tsx @@ -2,19 +2,19 @@ import { Redirect } from "wouter"; import { useAuth } from "../hooks/useAuth"; export default function PublicOnlyRoute({ - children, + children, }: { - children: React.ReactNode; + children: React.ReactNode; }) { - const { isLoggedIn, isLoading } = useAuth(); + const { isLoggedIn, isLoading } = useAuth(); - if (isLoading) { - return null; - } + if (isLoading) { + return null; + } - if (isLoggedIn) { - return <Redirect to="/dashboard" />; - } + if (isLoggedIn) { + return <Redirect to="/dashboard" />; + } - return <>{children}</>; + return <>{children}</>; } |
