1- import React , { startTransition , Suspense , useEffect , useState } from 'react' ;
2- import { ErrorBoundary as ReactErrorBoundary } from 'react-error-boundary' ;
1+ import React , { startTransition , useEffect , useState } from 'react' ;
32import DelegateNoAccessModalProvider from './components/DelegateNoAccessModalProvider' ;
43import EmojiPicker from './components/EmojiPicker/EmojiPicker' ;
54import GrowlNotification from './components/GrowlNotification' ;
5+ import LazyModalSlot from './components/LazyModalSlot' ;
66import * as EmojiPickerAction from './libs/actions/EmojiPickerAction' ;
77import { growlRef } from './libs/Growl' ;
8- import Log from './libs/Log' ;
98import * as ReportActionContextMenu from './pages/inbox/report/ContextMenu/ReportActionContextMenu' ;
109
1110const LazyPopoverReportActionContextMenu = React . lazy ( ( ) => import ( './pages/inbox/report/ContextMenu/PopoverReportActionContextMenu' ) ) ;
@@ -17,24 +16,6 @@ const LazyProactiveAppReviewModalManager = React.lazy(() => import('./components
1716// guaranteeing mount even if the main thread never becomes idle.
1817const IDLE_CALLBACK_TIMEOUT_MS = 2000 ;
1918
20- const logModalChunkFailure = ( error : Error , info : { componentStack ?: string | null } ) =>
21- Log . alert ( `[GlobalModals] lazy chunk failure - ${ error . message } ` , { componentStack : info . componentStack ?? undefined } , false ) ;
22-
23- /**
24- * Wraps a lazy modal in its own ErrorBoundary + Suspense pair so a chunk-load failure
25- * (or unrelated load latency) in one modal cannot tear down sibling modals or the rest of GlobalModals.
26- */
27- function LazyModalSlot ( { children} : { children : React . ReactNode } ) {
28- return (
29- < ReactErrorBoundary
30- fallback = { null }
31- onError = { logModalChunkFailure }
32- >
33- < Suspense fallback = { null } > { children } </ Suspense >
34- </ ReactErrorBoundary >
35- ) ;
36- }
37-
3819/**
3920 * Renders global modals and overlays that are mounted once at the top level.
4021 */
0 commit comments