File tree Expand file tree Collapse file tree
components/WideRHPContextProvider Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ import {navigationRef} from '@libs/Navigation/Navigation';
88 * @param allWideRHPKeys - an array of all Wide/Super Wide RHP keys
99 */
1010function getVisibleWideRHPKeys ( allWideRHPKeys : string [ ] ) {
11+ if ( ! navigationRef . isReady ( ) ) {
12+ return [ ] ;
13+ }
14+
1115 const rootState = navigationRef . getRootState ( ) ;
1216
1317 if ( ! rootState ) {
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ const closeRHPFlow = (ref = navigationRef) => originalCloseRHPFlow(ref);
123123 * Returns the current active route.
124124 */
125125function getActiveRoute ( ) : string {
126+ if ( ! navigationRef . isReady ( ) ) {
127+ return '' ;
128+ }
129+
126130 const currentRoute = navigationRef . current && navigationRef . current . getCurrentRoute ( ) ;
127131 if ( ! currentRoute ?. name ) {
128132 return '' ;
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import navigationRef from '@libs/Navigation/navigationRef';
33import type { AuthScreensParamList , NavigationPartialRoute } from '@libs/Navigation/types' ;
44
55export default function isRoutePreloaded ( routeName : keyof AuthScreensParamList ) {
6+ if ( ! navigationRef . isReady ( ) ) {
7+ return false ;
8+ }
69 const rootState = navigationRef . getRootState ( ) as NavigationState < AuthScreensParamList > & { preloadedRoutes : Array < NavigationPartialRoute < keyof AuthScreensParamList > > } ;
710 return rootState . preloadedRoutes . some ( ( preloadedRoute ) => preloadedRoute . name === routeName ) ;
811}
You can’t perform that action at this time.
0 commit comments