|
@@ -161,18 +161,17 @@ class SideBar extends React.Component<Props, State> {
|
161
|
161
|
}
|
162
|
162
|
|
163
|
163
|
onRouteChange = (event) => {
|
164
|
|
- if (event.data.state.routes !== undefined) {
|
165
|
|
- const route = event.data.state.routes[0]; // get the current route (ROOT)
|
166
|
|
- if (route.state !== undefined) {
|
167
|
|
- const state = route.state; // Get the Drawer's state if it exists
|
168
|
|
- // Get the current route name. This will only show Drawer routes.
|
169
|
|
- // Tab routes will be shown as 'Main'
|
170
|
|
- const routeName = state.routeNames[state.index];
|
171
|
|
- if (this.state.activeRoute !== routeName)
|
172
|
|
- this.setState({activeRoute: routeName});
|
173
|
|
- }
|
174
|
|
-
|
|
164
|
+ try {
|
|
165
|
+ const state = event.data.state.routes[0].state; // Get the Drawer's state if it exists
|
|
166
|
+ // Get the current route name. This will only show Drawer routes.
|
|
167
|
+ // Tab routes will be shown as 'Main'
|
|
168
|
+ const routeName = state.routeNames[state.index];
|
|
169
|
+ if (this.state.activeRoute !== routeName)
|
|
170
|
+ this.setState({activeRoute: routeName});
|
|
171
|
+ } catch(e) {
|
|
172
|
+ this.setState({activeRoute: 'Main'});
|
175
|
173
|
}
|
|
174
|
+
|
176
|
175
|
};
|
177
|
176
|
|
178
|
177
|
showDisconnectDialog = () => this.setState({dialogVisible: true});
|