Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 291ba2f

Browse files
committed
Fix navigation transition for reset
1 parent 2231715 commit 291ba2f

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/action/nav-mobile.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,20 @@ class NavAction {
1212
}
1313

1414
setTopLevelNavigator(navigatorRef) {
15-
this._navigate = (routeName, params) =>
16-
navigatorRef.dispatch(this._navActions.navigate({ routeName, params }));
17-
this._reset = (routeName, params) =>
15+
this._navigate = routeName =>
16+
navigatorRef.dispatch(this._navActions.navigate({ routeName }));
17+
18+
this._reset = (stackName, routeName) =>
1819
navigatorRef.dispatch(
19-
this._stackActions.reset({
20-
index: 0,
21-
actions: [this._navActions.navigate({ routeName, params })],
20+
this._navActions.navigate({
21+
routeName: stackName,
22+
action: this._stackActions.reset({
23+
index: 0,
24+
actions: [this._navActions.navigate({ routeName })],
25+
}),
2226
})
2327
);
28+
2429
this._store.navReady = true;
2530
}
2631

@@ -86,7 +91,7 @@ class NavAction {
8691

8792
goHome() {
8893
this._navigate('Home');
89-
this._reset('Home');
94+
this._reset('Main', 'Home');
9095
}
9196

9297
goPay() {

src/view/main-mobile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ const MainStack = createStackNavigator(
193193
NewAddress,
194194
Password,
195195
LoaderSyncing,
196+
Home,
196197
Settings,
197198
SettingsUnit,
198199
SettingsFiat,
@@ -244,7 +245,6 @@ const ChannelStack = createStackNavigator(
244245

245246
const RootStack = createStackNavigator(
246247
{
247-
Home,
248248
Main: MainStack,
249249
Invoice: InvoiceStack,
250250
Pay: PayStack,

0 commit comments

Comments
 (0)