fix(core): add view error boundary (#6036)

This commit is contained in:
EYHN
2024-03-11 07:09:46 +00:00
parent c93077f643
commit ba4637a6bd
4 changed files with 38 additions and 33 deletions

View File

@@ -6,6 +6,7 @@ import { useService } from '@toeverything/infra/di';
import { useAtomValue } from 'jotai';
import { Suspense, useCallback } from 'react';
import { AffineErrorBoundary } from '../../../components/affine/affine-error-boundary';
import {
appSidebarOpenAtom,
SidebarSwitch,
@@ -68,9 +69,11 @@ export const RouteContainer = ({ route }: Props) => {
)}
</div>
<view.body.Target className={styles.viewBodyContainer} />
<Suspense>
<route.Component />
</Suspense>
<AffineErrorBoundary>
<Suspense>
<route.Component />
</Suspense>
</AffineErrorBoundary>
</div>
);
};