Skip to content

Commit

Permalink
feat(web): maintenance mode should only shows on prod
Browse files Browse the repository at this point in the history
  • Loading branch information
mrevanzak committed May 23, 2024
1 parent 6d420e3 commit 92a1256
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/web/src/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { env } from "process";
import { Footer } from "@/components/footer";
import { Navbar } from "@/components/navbar";
import { SidebarWrapper } from "@/components/sidebar/sidebar";
import { env } from "@/env";
import { auth } from "@/server/auth";
import { get } from "@vercel/edge-config";

Expand All @@ -18,10 +18,9 @@ export default async function AuthLayout(props: {

const isMaintenance = await get("maintenance");

if (isMaintenance && !isAdmin) {
if (isMaintenance && !isAdmin && env.NODE_ENV !== "development") {
const message =
"Unfortunatly, we are under maintenance. We will be back soon!";
if (env.NODE_ENV === "development") throw new Error(message);
"Unfortunately, the site is currently under maintenance. We'll be back soon!";

return (
<ErrorPage
Expand Down

0 comments on commit 92a1256

Please sign in to comment.