@@ -31,6 +31,13 @@ import { useUiRuntimeMemoryWarningGc } from "./lib/useUiRuntimeMemoryWarningGc";
3131import { SubscriptionUsageCoordinator } from "./widgets/SubscriptionUsageCoordinator" ;
3232import { VoiceInputProvider } from "./features/voice-input/VoiceInputProvider" ;
3333import { GlobalVoiceInputControl } from "./features/voice-input/GlobalVoiceInputControl" ;
34+ import { restoreSettingsLinkState } from "./features/settings/settings-navigation" ;
35+ import {
36+ hydrateWorkspaceSelections ,
37+ launchWorkspaceURL ,
38+ recordWorkspaceSelections ,
39+ settingsLinkPage ,
40+ } from "./features/workspace/workspace-selection-store" ;
3441import { NativeLayoutMetricsProvider } from "./native/native-layout-metrics" ;
3542
3643import "../global.css" ;
@@ -40,13 +47,18 @@ if (process.env.EXPO_PUBLIC_SHOWCASE === "1") {
4047}
4148
4249void SplashScreen . preventAutoHideAsync ( ) . catch ( ( ) => { } ) ;
50+ void hydrateWorkspaceSelections ( ) ;
4351
4452const appLinking = {
4553 prefixes : [ Linking . createURL ( "/" ) , "t3code://" , "t3code-dev://" , "t3code-preview://" ] ,
4654 config : { initialRouteName : "Home" } ,
4755 filter : shouldHandleAppLink ,
56+ getInitialURL : async ( ) => ( await Linking . getInitialURL ( ) ) ?? ( await launchWorkspaceURL ( ) ) ,
4857 getStateFromPath : ( path : string , options : Parameters < typeof getStateFromPath > [ 1 ] ) =>
49- restoreDraftLinkState ( getStateFromPath ( path , options ) , path ) ,
58+ restoreSettingsLinkState (
59+ restoreDraftLinkState ( getStateFromPath ( path , options ) , path ) ,
60+ settingsLinkPage ( ) ,
61+ ) ,
5062} ;
5163
5264const Navigation = createStaticNavigation ( RootStack ) ;
@@ -107,7 +119,11 @@ function AppContent() {
107119 < GlobalVoiceInputControl >
108120 < NativeLayoutMetricsProvider >
109121 < IncomingShareProvider >
110- < Navigation linking = { appLinking } theme = { navigationTheme } />
122+ < Navigation
123+ linking = { appLinking }
124+ theme = { navigationTheme }
125+ onStateChange = { recordWorkspaceSelections }
126+ />
111127 </ IncomingShareProvider >
112128 < Dialog . Host />
113129 < ThreadArrangementHost />
0 commit comments