Skip to content

Commit

Permalink
Merge pull request #53165 from Expensify/vit-53150
Browse files Browse the repository at this point in the history
[CP Staging] Make sure to check the navBarManager is defined

(cherry picked from commit d69518c)

(CP triggered by mountiny)
  • Loading branch information
luacmartins authored and OSBotify committed Nov 26, 2024
1 parent 337218f commit f3cfec5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libs/NavBarManager/index.android.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import {NativeModules} from 'react-native';
import Log from '@libs/Log';
import type StartupTimer from './types';
import type {NavBarButtonStyle} from './types';

const navBarManager: StartupTimer = {
setButtonStyle: (style: NavBarButtonStyle) => {
if (!NativeModules.RNNavBarManager) {
Log.hmmm('RNNavBarManager not found');
return;
}

NativeModules.RNNavBarManager.setButtonStyle(style);
},
};
Expand Down
4 changes: 4 additions & 0 deletions src/libs/Navigation/AppNavigator/AuthScreens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie
});

useEffect(() => {
if (!NavBarManager) {
Log.hmmm('RNNavBarManager not found in AuthScreens');
return;
}
NavBarManager.setButtonStyle(theme.navigationBarButtonsStyle);

return () => {
Expand Down

0 comments on commit f3cfec5

Please sign in to comment.