Update title in beforeDestroy() (#14408)

This commit is contained in:
Patrick Delaney
2022-12-15 20:48:08 +00:00
committed by GitHub
parent 42e0bad4ac
commit 7309ab4fd4
2 changed files with 8 additions and 15 deletions

View File

@@ -863,16 +863,13 @@ export default {
this.loadUser();
this.oldTitle = this.$store.state.title;
this.selectPage(this.startingPage);
this.$root.$on('habitica:restoreTitle', () => {
if (this.oldTitle) {
this.$store.dispatch('common:setTitle', {
fullTitle: this.oldTitle,
});
}
});
},
beforeDestroy () {
this.$root.$off('habitica:restoreTitle');
if (this.oldTitle) {
this.$store.dispatch('common:setTitle', {
fullTitle: this.oldTitle,
});
}
},
methods: {
async loadUser () {