Skip to content

Commit

Permalink
Merge pull request #275 from AmbireTech/create-campaign-refactor-cont…
Browse files Browse the repository at this point in the history
…inue

fix white screen on new browser/device
  • Loading branch information
ivopaunov authored Aug 27, 2024
2 parents 5e28b8a + 168a2b5 commit c688ebe
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 c688ebe

Please sign in to comment.