Browse Source

Add error boundary to ClientConfigStore modal. For #2811

pull/2815/head
Gabe Kangas 2 years ago
parent
commit
274aeb8be6
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
  1. 12
      web/components/layouts/Main/Main.tsx

12
web/components/layouts/Main/Main.tsx

@ -6,6 +6,7 @@ import { FC, useEffect, useRef } from 'react'; @@ -6,6 +6,7 @@ import { FC, useEffect, useRef } from 'react';
import { Layout } from 'antd';
import dynamic from 'next/dynamic';
import Script from 'next/script';
import { ErrorBoundary } from 'react-error-boundary';
import {
ClientConfigStore,
isChatAvailableSelector,
@ -139,8 +140,17 @@ export const Main: FC = () => { @@ -139,8 +140,17 @@ export const Main: FC = () => {
<title>{name}</title>
</Head>
)}
<ErrorBoundary
// eslint-disable-next-line react/no-unstable-nested-components
fallbackRender={({ error }) => (
<FatalErrorStateModal
title="Error"
message={`There was an unexpected error. Please refresh the page to retry. If this error continues please file a bug with the Owncast project: ${error}`}
/>
)}
>
<ClientConfigStore />
</ErrorBoundary>
<PushNotificationServiceWorker />
<TitleNotifier name={name} />
<Theme />

Loading…
Cancel
Save