@@ -21,9 +21,13 @@ import { ThreadArrangementHost } from "./features/threads/ThreadArrangementSheet
2121import * as Dialog from "./components/ui/Dialog" ;
2222import { CloudAuthProvider } from "./features/cloud/CloudAuthProvider" ;
2323import { prepareNativeShowcaseCapture } from "./features/showcase/nativeShowcaseScene" ;
24- import { IncomingShareProvider } from "./features/sharing/IncomingShareProvider" ;
24+ import {
25+ presentPendingIncomingShare ,
26+ startIncomingShareInbox ,
27+ } from "./features/sharing/IncomingShareProvider" ;
2528import {
2629 AppearancePreferencesProvider ,
30+ installAppearanceRuntime ,
2731 useAppearancePreferences ,
2832} from "./features/settings/appearance/AppearancePreferencesProvider" ;
2933import { RootStack } from "./Stack" ;
@@ -40,8 +44,9 @@ import {
4044 type FoundationHotModule ,
4145} from "./lib/foundation-fast-refresh" ;
4246import { useMobileNavigationTheme } from "./lib/useMobileNavigationTheme" ;
43- import { useUiRuntimeMemoryWarningGc } from "./lib/useUiRuntimeMemoryWarningGc" ;
47+ import { installUiRuntimeMemoryWarningGc } from "./lib/useUiRuntimeMemoryWarningGc" ;
4448import { SubscriptionUsageCoordinator } from "./widgets/SubscriptionUsageCoordinator" ;
49+ import { installSubscriptionUsageRefresh } from "./widgets/useSubscriptionUsage" ;
4550import { GlobalVoiceInputControl } from "./features/voice-input/GlobalVoiceInputControl" ;
4651import { restoreSettingsLinkState } from "./features/settings/settings-navigation" ;
4752import {
@@ -90,6 +95,7 @@ const Navigation = createStaticNavigation(RootStack);
9095function handleNavigationStateChange ( state : NavigationState | undefined ) : void {
9196 recordWorkspaceSelections ( state ) ;
9297 if ( state ) pruneNewTaskBranchCheckouts ( state ) ;
98+ presentPendingIncomingShare ( ) ;
9399}
94100
95101function handleNavigationReady ( ) : void {
@@ -99,9 +105,19 @@ function handleNavigationReady(): void {
99105declare const module : { readonly hot ?: FoundationHotModule } | undefined ;
100106
101107const appServiceDisposers = [
108+ installUiRuntimeMemoryWarningGc ( ) ,
109+ subscribeComposerDraftModelReconciliation ( {
110+ registry : appAtomRegistry ,
111+ threadShellAtom : environmentThreadShells . threadShellAtom ,
112+ threadRefsAtom : environmentThreadShells . threadRefsAtom ,
113+ shellStateAtom : environmentShell . stateAtom ,
114+ } ) ,
115+ installAppearanceRuntime ( ) ,
116+ installSubscriptionUsageRefresh ( ) ,
102117 installPermissionUpdateNotice ( ) ,
103118 installThreadOutboxDelivery ( ) ,
104119 installComposerAttachmentUploads ( ) ,
120+ startIncomingShareInbox ( ) ,
105121] ;
106122disposeOnFoundationReplace ( typeof module === "undefined" ? undefined : module . hot , ( ) => {
107123 for ( const dispose of appServiceDisposers ) dispose ( ) ;
@@ -118,18 +134,6 @@ function SplashScreenCoordinator() {
118134}
119135
120136export default function App ( ) {
121- useUiRuntimeMemoryWarningGc ( ) ;
122- useEffect (
123- ( ) =>
124- subscribeComposerDraftModelReconciliation ( {
125- registry : appAtomRegistry ,
126- threadShellAtom : environmentThreadShells . threadShellAtom ,
127- threadRefsAtom : environmentThreadShells . threadRefsAtom ,
128- shellStateAtom : environmentShell . stateAtom ,
129- } ) ,
130- [ ] ,
131- ) ;
132-
133137 return (
134138 < RegistryContext . Provider value = { appAtomRegistry } >
135139 < CloudAuthProvider >
@@ -156,15 +160,13 @@ function AppContent() {
156160 { /* native-stack needs the theme's dark flag to select dark native headers. */ }
157161 < GlobalVoiceInputControl >
158162 < NativeLayoutMetricsProvider >
159- < IncomingShareProvider >
160- < Navigation
161- ref = { attachRootNavigation }
162- linking = { appLinking }
163- onReady = { handleNavigationReady }
164- theme = { navigationTheme }
165- onStateChange = { handleNavigationStateChange }
166- />
167- </ IncomingShareProvider >
163+ < Navigation
164+ ref = { attachRootNavigation }
165+ linking = { appLinking }
166+ onReady = { handleNavigationReady }
167+ theme = { navigationTheme }
168+ onStateChange = { handleNavigationStateChange }
169+ />
168170 < Dialog . Host />
169171 < ThreadArrangementHost />
170172 < ProjectChipIconRasterizer />
0 commit comments