fixed topic subscription on page reload

This commit is contained in:
or-else
2021-06-18 19:13:59 -07:00
parent 3fcd118af8
commit 2d01e0af85
5 changed files with 11 additions and 20 deletions
+3 -7
View File
@@ -268,15 +268,11 @@ class TinodeWeb extends React.Component {
// Socket error // Socket error
this.handleError(err.message, 'err'); this.handleError(err.message, 'err');
}); });
delete parsedNav.params.info; }
delete parsedNav.params.tab;
parsedNav.path[0] = ''; // Save possible topic name and navigate to blank state.
HashNavigation.navigateTo(HashNavigation.composeUrlHash(parsedNav.path, parsedNav.params));
} else if (!parsedNav.params.token) {
// No token, save possible topic name and navigating to blank state.
this.setState({requestedTopic: parsedNav.path[1]}); this.setState({requestedTopic: parsedNav.path[1]});
HashNavigation.navigateTo(''); HashNavigation.navigateTo('');
}
this.readTimer = null; this.readTimer = null;
this.readTimerCallback = null; this.readTimerCallback = null;
+2 -7
View File
@@ -5055,17 +5055,12 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
this.tinode.connect().catch(err => { this.tinode.connect().catch(err => {
this.handleError(err.message, 'err'); this.handleError(err.message, 'err');
}); });
delete parsedNav.params.info; }
delete parsedNav.params.tab;
parsedNav.path[0] = '';
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_16__.default.navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_16__.default.composeUrlHash(parsedNav.path, parsedNav.params));
} else if (!parsedNav.params.token) {
this.setState({ this.setState({
requestedTopic: parsedNav.path[1] requestedTopic: parsedNav.path[1]
}); });
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_16__.default.navigateTo(''); _lib_navigation_js__WEBPACK_IMPORTED_MODULE_16__.default.navigateTo('');
}
this.readTimer = null; this.readTimer = null;
this.readTimerCallback = null; this.readTimerCallback = null;
this.handleHashRoute(); this.handleHashRoute();
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long