Revert "Fixes public apps page (#2422)" (#2461)

This reverts commit 81f3e824ff.
pull/2462/head
Bailey Pumfleet 2022-04-11 16:11:35 +01:00 committed by GitHub
parent 81f3e824ff
commit a5522c98a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -57,10 +57,9 @@ function useRedirectToLoginIfUnauthenticated() {
const { data: session, status } = useSession(); const { data: session, status } = useSession();
const loading = status === "loading"; const loading = status === "loading";
const router = useRouter(); const router = useRouter();
const shouldDisplayUnauthed = router.pathname.startsWith("/apps");
useEffect(() => { useEffect(() => {
if (shouldDisplayUnauthed) { if (router.pathname.startsWith("/apps")) {
return; return;
} }
@ -77,7 +76,6 @@ function useRedirectToLoginIfUnauthenticated() {
return { return {
loading: loading && !session, loading: loading && !session,
shouldDisplayUnauthed,
session, session,
}; };
} }
@ -136,7 +134,7 @@ export default function Shell(props: {
}) { }) {
const { t } = useLocale(); const { t } = useLocale();
const router = useRouter(); const router = useRouter();
const { loading, shouldDisplayUnauthed } = useRedirectToLoginIfUnauthenticated(); const { loading, session } = useRedirectToLoginIfUnauthenticated();
const { isRedirectingToOnboarding } = useRedirectToOnboardingIfNeeded(); const { isRedirectingToOnboarding } = useRedirectToOnboardingIfNeeded();
const telemetry = useTelemetry(); const telemetry = useTelemetry();
@ -209,7 +207,7 @@ export default function Shell(props: {
); );
} }
if (!shouldDisplayUnauthed) return null; if (!session) return null;
return ( return (
<> <>