mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Merge pull request #3025 from weaveworks/3024-stop-page-router-on-unmount
Stop page router on App unmount
This commit is contained in:
@@ -76,7 +76,9 @@ class App extends React.Component {
|
||||
window.addEventListener('keypress', this.onKeyPress);
|
||||
window.addEventListener('keyup', this.onKeyUp);
|
||||
|
||||
getRouter(this.props.dispatch, this.props.urlState).start({hashbang: true});
|
||||
this.router = getRouter(this.props.dispatch, this.props.urlState);
|
||||
this.router.start({ hashbang: true });
|
||||
|
||||
if (!this.props.routeSet || process.env.WEAVE_CLOUD) {
|
||||
// dont request topologies when already done via router.
|
||||
// If running as a component, always request topologies when the app mounts.
|
||||
@@ -90,6 +92,7 @@ class App extends React.Component {
|
||||
window.removeEventListener('keypress', this.onKeyPress);
|
||||
window.removeEventListener('keyup', this.onKeyUp);
|
||||
this.props.dispatch(shutdown());
|
||||
this.router.stop();
|
||||
}
|
||||
|
||||
onKeyUp(ev) {
|
||||
|
||||
Reference in New Issue
Block a user