Skip to content

Commit d9c8920

Browse files
committed
fetchActions: Compare all routes to 'main', not just the first.
I think we generally expect the 'main' route to be index zero of the routes, when it's among the routes. But it's not obvious that this will always hold, and it's quite easy to check all the routes.
1 parent 0cef857 commit d9c8920

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/message/fetchActions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const initialFetchCompletePlain = (): Action => ({
163163
});
164164

165165
export const initialFetchComplete = () => async (dispatch: Dispatch, getState: GetState) => {
166-
if (getNavigationRoutes()[0] !== 'main') {
166+
if (!getNavigationRoutes().some(navigationRoute => navigationRoute.routeName === 'main')) {
167167
// If we're anywhere in the normal UI of the app, then remain
168168
// where we are. Only reset the nav state if we're elsewhere,
169169
// and in that case, go to the main screen.

0 commit comments

Comments
 (0)