Skip to content

Commit ce3fac5

Browse files
authored
fix undefined issue and timing issue w/ nav in show monster flow (keybase#25590)
1 parent 4cc2a58 commit ce3fac5

3 files changed

Lines changed: 8 additions & 13 deletions

File tree

‎shared/actions/config/index.tsx‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -318,21 +318,14 @@ const maybeDoneWithLogoutHandshake = async (state: Container.TypedState) => {
318318
}
319319
}
320320

321-
const showMonsterPushPrompt = () => [
322-
RouteTreeGen.createSwitchLoggedIn({loggedIn: true}),
323-
RouteTreeGen.createSwitchTab({tab: Tabs.peopleTab}),
324-
RouteTreeGen.createNavigateAppend({
325-
path: ['settingsPushPrompt'],
326-
}),
327-
]
328-
329321
// Monster push prompt
330322
// We've just started up, we don't have the permissions, we're logged in and we
331323
// haven't just signed up. This handles the scenario where the push notifications
332324
// permissions checker finishes after the routeToInitialScreen is done.
333-
const onShowPermissionsPrompt = (
325+
const onShowPermissionsPrompt = async (
334326
state: Container.TypedState,
335-
action: PushGen.ShowPermissionsPromptPayload
327+
action: PushGen.ShowPermissionsPromptPayload,
328+
listenerApi: Container.ListenerApi
336329
) => {
337330
if (
338331
!Platform.isMobile ||
@@ -345,7 +338,10 @@ const onShowPermissionsPrompt = (
345338
}
346339

347340
logger.info('[ShowMonsterPushPrompt] Entered through the late permissions checker scenario')
348-
return showMonsterPushPrompt()
341+
listenerApi.dispatch(RouteTreeGen.createSwitchLoggedIn({loggedIn: true}))
342+
await Container.timeoutPromise(100)
343+
listenerApi.dispatch(RouteTreeGen.createSwitchTab({tab: Tabs.peopleTab}))
344+
listenerApi.dispatch(RouteTreeGen.createNavigateAppend({path: ['settingsPushPrompt']}))
349345
}
350346

351347
const onAndroidShare = (state: Container.TypedState) => {

‎shared/constants/router2.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const oldActionToNewActions = (action: RTGActions, navigationState: any, allowAp
141141
return [
142142
{
143143
...CommonActions.navigate({name: action.payload.tab, params: action.payload.params}),
144-
target: navigationState.routes[0].state.key,
144+
target: navigationState.routes[0]?.state?.key,
145145
},
146146
]
147147
}

‎shared/router-v2/router-linking.native.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ const makeLinking = (options: OptionsType) => {
4141
}, {}),
4242
},
4343
},
44-
settingsPushPrompt: 'settingsPushPrompt',
4544
},
4645
},
4746
draft => {

0 commit comments

Comments
 (0)