diff --git a/mobile/app/_layout.tsx b/mobile/app/_layout.tsx
index 1059c95502a..fe89a82c4a0 100644
--- a/mobile/app/_layout.tsx
+++ b/mobile/app/_layout.tsx
@@ -184,6 +184,7 @@ export default function RootLayout() {
/>
+
diff --git a/mobile/app/native-chat-settings.tsx b/mobile/app/native-chat-settings.tsx
index bc940765e46..ddbf4e6eccc 100644
--- a/mobile/app/native-chat-settings.tsx
+++ b/mobile/app/native-chat-settings.tsx
@@ -34,7 +34,12 @@ export default function NativeChatSettingsScreen() {
return (
- router.back()}>
+ router.back()}
+ >
Native chat
@@ -57,6 +62,7 @@ export default function NativeChatSettingsScreen() {
{chatDefault ? 'On' : 'Off'}
(): { promise: Promise; resolve: (value: T) => void } {
+ let resolve!: (value: T) => void
+ const promise = new Promise((resolvePromise) => {
+ resolve = resolvePromise
+ })
+ return { promise, resolve }
+}
+
vi.mock('expo-router', async () => {
const react = await import('react')
return {
@@ -105,4 +113,124 @@ describe('useMobileSessionViewMode', () => {
expect(vi.mocked(saveSessionViewOverrides).mock.calls.at(-1)?.[2].get('t1')).toBe('chat')
expect(controller?.isTabChatView('t1')).toBe(true)
})
+
+ it('does not expose overrides from the previous host while the next scope loads', async () => {
+ const nextScopeLoad = deferred