Skip to content

Commit

Permalink
views: HomeFave: call init when user presses back
Browse files Browse the repository at this point in the history
This is to load the tab that is activated in history. Also removes the
onpopstate upon deactivate so that
init is not called multiple times or on other unrelated pages.
  • Loading branch information
INCENDE committed Sep 12, 2023
1 parent 8c854d4 commit bbe0ad4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/views/HomeFave.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,15 @@ export default {
console.log("Activated, so adding refresh timer to HomeFav");
this.changeTab(true);
this.setAutoRefresh();
window.onpopstate = () => { this.init(); };
},
deactivated() {
if (this.refreshTimer) {
console.log("Navigating away, so deleting the refresh timer in HomeFav");
clearInterval(this.refreshTimer);
this.refreshTimer = null;
}
window.onpopstate = () => { };
},
beforeDestroy() {
console.log("Destroying, so deleting the refresh timer in HomeFav");
Expand Down

0 comments on commit bbe0ad4

Please sign in to comment.