From 671039d8219171fc668506be52ae2274c0011076 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 17 Apr 2024 21:04:39 +0800 Subject: [PATCH] use const --- src/libs/Navigation/getTopmostBottomTabRoute.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/Navigation/getTopmostBottomTabRoute.ts b/src/libs/Navigation/getTopmostBottomTabRoute.ts index e156b567af0d..48a8d80f4096 100644 --- a/src/libs/Navigation/getTopmostBottomTabRoute.ts +++ b/src/libs/Navigation/getTopmostBottomTabRoute.ts @@ -1,10 +1,11 @@ +import NAVIGATORS from '@src/NAVIGATORS'; import type {BottomTabName, NavigationPartialRoute, RootStackParamList, State} from './types'; function getTopmostBottomTabRoute(state: State | undefined): NavigationPartialRoute | undefined { - const bottomTabNavigatorRoute = state?.routes.findLast((route) => route.name === 'BottomTabNavigator'); + const bottomTabNavigatorRoute = state?.routes.findLast((route) => route.name === NAVIGATORS.BOTTOM_TAB_NAVIGATOR); // The bottomTabNavigatorRoute state may be empty if we just logged in. - if (!bottomTabNavigatorRoute || bottomTabNavigatorRoute.name !== 'BottomTabNavigator' || bottomTabNavigatorRoute.state === undefined) { + if (!bottomTabNavigatorRoute || bottomTabNavigatorRoute.name !== NAVIGATORS.BOTTOM_TAB_NAVIGATOR || bottomTabNavigatorRoute.state === undefined) { return undefined; }