From 85d54926eed8751d86d8de704335dc508cdb7f37 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sun, 12 Mar 2023 22:53:57 -0700 Subject: [PATCH] Add error boundary to Auth modal. For #2811 --- web/components/modals/AuthModal/AuthModal.tsx | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/web/components/modals/AuthModal/AuthModal.tsx b/web/components/modals/AuthModal/AuthModal.tsx index ac681dcd7..26ec66720 100644 --- a/web/components/modals/AuthModal/AuthModal.tsx +++ b/web/components/modals/AuthModal/AuthModal.tsx @@ -1,6 +1,7 @@ import { Tabs } from 'antd'; import { useRecoilValue } from 'recoil'; import { FC } from 'react'; +import { ErrorBoundary } from 'react-error-boundary'; import { IndieAuthModal } from '../IndieAuthModal/IndieAuthModal'; import { FediAuthModal } from '../FediAuthModal/FediAuthModal'; @@ -12,6 +13,7 @@ import { clientConfigStateAtom, } from '../../stores/ClientConfigStore'; import { ClientConfig } from '../../../interfaces/client-config.model'; +import { ComponentError } from '../../ui/ComponentError/ComponentError'; export type AuthModalProps = { forceTabs?: boolean; @@ -66,14 +68,25 @@ export const AuthModal: FC = ({ forceTabs }) => { ]; return ( -
- null} - /> -
+ ( + + )} + > +
+ null} + /> +
+
); };