Skip to content

Commit

Permalink
Merge pull request #3025 from weaveworks/3024-stop-page-router-on-unm…
Browse files Browse the repository at this point in the history
…ount

Stop page router on App unmount
  • Loading branch information
fbarl authored Jan 17, 2018
2 parents e37a147 + acfe66c commit 0dedbea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/app/scripts/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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) {
Expand Down

0 comments on commit 0dedbea

Please sign in to comment.