diff --git a/app/root.tsx b/app/root.tsx index cf89581..fde7417 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -61,42 +61,6 @@ export function ErrorBoundary() { const { status } = error; const loaderData = useRouteLoaderData("root") || {}; - if (loaderData.mx) - return ( - - - - - - - - - - -
- - The engineers are breaking stuff again - -
- - Someday they will finish, come back later. - -
-
- ); - switch (status) { case 303: return ""; @@ -132,6 +96,42 @@ export function ErrorBoundary() { ); + case 503: + return ( + + + + + + + + + + +
+ + The engineers are breaking stuff again + +
+ + Someday they will finish, come back later. + +
+
+ ); + default: captureRemixErrorBoundaryError(useRouteError()); return ( @@ -166,6 +166,11 @@ export async function loader({ }: { context: RequestContext; }): Promise<{ [k: string]: any }> { + if (await context.env.DATA.get("mx")) + throw new Response(null, { + status: 503, + }); + let data: { [k: string]: string } = {}; if (context.env.COMMIT_SHA) data.commit_sha = context.env.COMMIT_SHA; @@ -174,10 +179,6 @@ export async function loader({ if (context.data.nonce) data.nonce = context.data.nonce; if (context.data.theme) data.theme = context.data.theme; - try { - if (await context.env.DATA.get("mx")) data.mx = "1"; - } catch {} - return data; }