Skip to content

Commit

Permalink
fix white screen on new browser/device
Browse files Browse the repository at this point in the history
  • Loading branch information
ivopaunov committed Aug 27, 2024
1 parent 2c21567 commit 168a2b5
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,9 @@ function ErrorBoundary() {
}

function RequireAuth({ children, admin }: { children: JSX.Element; admin?: boolean }) {
const {
authenticated,
isAdmin,
adexAccount: { loaded, initialLoad }
} = useAccount()
const { authenticated, isAdmin } = useAccount()
const location = useLocation()

if (!loaded && !initialLoad) {
return null // Or a loading spinner
}

if (!authenticated) {
return <Navigate to="/login" state={{ from: location }} replace />
}
Expand Down

0 comments on commit 168a2b5

Please sign in to comment.