Skip to content

Commit 594500d

Browse files
WIP
1 parent 71e8681 commit 594500d

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

shared/constants/router.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export const getModalStack = (navState?: T.Immutable<NavState>) => {
124124
if (!_isLoggedIn(rs)) {
125125
return []
126126
}
127-
return (rs.routes?.slice(1) ?? []).filter((r: Route) => !rootNonModalRouteNames.has(r.name))
127+
return (rs.routes?.slice(1) ?? []).filter(r => !rootNonModalRouteNames.has(r.name))
128128
}
129129

130130
export const getVisibleScreen = (navState?: T.Immutable<NavState>, _inludeModals?: boolean) => {
@@ -184,7 +184,7 @@ export const clearModals = () => {
184184
}
185185
const rootRoutes = ns?.routes ?? []
186186
const keepRoutes = rootRoutes.filter(
187-
(route: Route, index: number) => index === 0 || rootNonModalRouteNames.has(route.name)
187+
(route, index) => index === 0 || rootNonModalRouteNames.has(route.name)
188188
)
189189
if (keepRoutes.length !== rootRoutes.length) {
190190
n.dispatch({

shared/router-v2/common.native.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ const styles = Kb.Styles.styleSheetCreate(() => ({
8787

8888
export const useSubnavTabAction = (navigation: NavigationContainerRef<object>, state: NavState) => {
8989
const onSelectTab = (tab: string) => {
90-
const route = state?.routes?.find((r: NonNullable<NavState['routes']>[number]) => r.name === tab)
90+
const routes = state && 'routes' in state ? state.routes : undefined
91+
const route = routes?.find(r => r.name === tab)
9192
const event = route
9293
? navigation.emit({
9394
canPreventDefault: true,

0 commit comments

Comments
 (0)