From c8add8ea51319b3ded044a4979e7656ecc4bf6eb Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Tue, 1 Mar 2022 16:36:52 -0800 Subject: [PATCH] Hide 404 for private Manifolds --- web/lib/firebase/init.ts | 1 + web/pages/404.tsx | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/web/lib/firebase/init.ts b/web/lib/firebase/init.ts index 145d67c5..f183d094 100644 --- a/web/lib/firebase/init.ts +++ b/web/lib/firebase/init.ts @@ -34,6 +34,7 @@ const FIREBASE_CONFIGS = { }, } const ENV = process.env.NEXT_PUBLIC_FIREBASE_ENV ?? 'PROD' +export const IS_PRIVATE_MANIFOLD = !['PROD', 'DEV'].includes(ENV) // @ts-ignore const firebaseConfig = FIREBASE_CONFIGS[ENV] // Initialize Firebase diff --git a/web/pages/404.tsx b/web/pages/404.tsx index 7e9c9e27..3908a051 100644 --- a/web/pages/404.tsx +++ b/web/pages/404.tsx @@ -1,8 +1,14 @@ import { useEffect } from 'gridjs' import { Page } from '../components/page' import { Title } from '../components/title' +import { IS_PRIVATE_MANIFOLD } from '../lib/firebase/init' export default function Custom404() { + if (IS_PRIVATE_MANIFOLD) { + // Since private Manifolds are client-side rendered, they'll blink the 404 + // So we just show a blank page here: + return + } return (