Skip to content

Commit

Permalink
Merge pull request #40330 from bernhardoj/fix/39926-wrong-bottom-icon…
Browse files Browse the repository at this point in the history
…-highlighted

Fix chat icon is highlighted after returning from share log page
  • Loading branch information
amyevans authored Apr 17, 2024
2 parents 290f482 + 671039d commit 1f694e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/Navigation/getTopmostBottomTabRoute.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import NAVIGATORS from '@src/NAVIGATORS';
import type {BottomTabName, NavigationPartialRoute, RootStackParamList, State} from './types';

function getTopmostBottomTabRoute(state: State<RootStackParamList> | undefined): NavigationPartialRoute<BottomTabName> | undefined {
const bottomTabNavigatorRoute = state?.routes[0];
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;
}

Expand Down

0 comments on commit 1f694e2

Please sign in to comment.