Skip to content

Commit a67b010

Browse files
committed
navReducer [nfc]: Remove a initial: true params hack.
In the previous commit, we removed our last call site of `getStateWithRoute` where 'realm' was passed for `route`. Therefore, this conditional can disappear. See more about this hack at zulip#4273 (comment).
1 parent 891b2b3 commit a67b010

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/nav/navReducer.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,7 @@ import { INITIAL_FETCH_COMPLETE, ACCOUNT_SWITCH, LOGIN_SUCCESS, LOGOUT } from '.
1111
* Private; exported only for tests.
1212
*/
1313
export const getStateForRoute = (route: string): NavigationState => {
14-
// TODO: this is kind of a hack! Refactor to a better way.
15-
// * Perhaps pass `initial: true` unconditionally in this initialization
16-
// code, to all routes? Then that'd just be part of the interface of
17-
// making a screen work as an initial screen.
18-
// * Alternatively, we could replace the whole system of `ModalNavBar`,
19-
// `canGoBack`, etc., with our own "navigation view" that would be more
20-
// directly integrated into the navigation framework:
21-
// https://reactnavigation.org/docs/en/2.x/navigation-views.html
22-
const params = route === 'realm' ? { initial: true } : undefined;
23-
24-
const action = AppNavigator.router.getActionForPathAndParams(route, params);
14+
const action = AppNavigator.router.getActionForPathAndParams(route);
2515
if (!action) {
2616
// The argument should be a constant string that is a genuine nav route;
2717
// so this condition can only happen if we've gotten that wrong.

0 commit comments

Comments
 (0)