Add error boundary to ClientConfigStore modal. For #2811
This commit is contained in:
@@ -6,6 +6,7 @@ import { FC, useEffect, useRef } from 'react';
|
|||||||
import { Layout } from 'antd';
|
import { Layout } from 'antd';
|
||||||
import dynamic from 'next/dynamic';
|
import dynamic from 'next/dynamic';
|
||||||
import Script from 'next/script';
|
import Script from 'next/script';
|
||||||
|
import { ErrorBoundary } from 'react-error-boundary';
|
||||||
import {
|
import {
|
||||||
ClientConfigStore,
|
ClientConfigStore,
|
||||||
isChatAvailableSelector,
|
isChatAvailableSelector,
|
||||||
@@ -139,8 +140,17 @@ export const Main: FC = () => {
|
|||||||
<title>{name}</title>
|
<title>{name}</title>
|
||||||
</Head>
|
</Head>
|
||||||
)}
|
)}
|
||||||
|
<ErrorBoundary
|
||||||
<ClientConfigStore />
|
// 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 />
|
<PushNotificationServiceWorker />
|
||||||
<TitleNotifier name={name} />
|
<TitleNotifier name={name} />
|
||||||
<Theme />
|
<Theme />
|
||||||
|
|||||||
Reference in New Issue
Block a user