Просмотр исходного кода

Merge pull request #23692 from overleaf/em-history-errors

Move error boundary inside history container

GitOrigin-RevId: cd4c911cef18b50cd4187f655e818c9ab851cfe0
Eric Mc Sween 1 год назад
Родитель
Сommit
ae491f910b

+ 1 - 3
services/web/frontend/js/features/ide-react/components/history-container.tsx

@@ -1,7 +1,5 @@
 import { useLayoutContext } from '../../../shared/context/layout-context'
 import { FullSizeLoadingSpinner } from '../../../shared/components/loading-spinner'
-import { ErrorBoundaryFallback } from '../../../shared/components/error-boundary-fallback'
-import withErrorBoundary from '../../../infrastructure/error-boundary'
 import { lazy, Suspense } from 'react'
 
 const HistoryRoot = lazy(
@@ -22,4 +20,4 @@ function HistoryContainer() {
   )
 }
 
-export default withErrorBoundary(HistoryContainer, ErrorBoundaryFallback)
+export default HistoryContainer

+ 3 - 1
services/web/frontend/js/features/ide-react/components/history-root.tsx

@@ -1,5 +1,7 @@
 import { memo } from 'react'
 import { HistoryProvider } from '@/features/history/context/history-context'
+import withErrorBoundary from '@/infrastructure/error-boundary'
+import { ErrorBoundaryFallback } from '@/shared/components/error-boundary-fallback'
 import History from './history'
 
 const HistoryRoot = () => (
@@ -8,4 +10,4 @@ const HistoryRoot = () => (
   </HistoryProvider>
 )
 
-export default memo(HistoryRoot)
+export default withErrorBoundary(memo(HistoryRoot), ErrorBoundaryFallback)