From 7309ab4fd46c9c8f9592192d4d7147a651291aa2 Mon Sep 17 00:00:00 2001 From: Patrick Delaney Date: Thu, 15 Dec 2022 20:48:08 +0000 Subject: [PATCH] Update title in beforeDestroy() (#14408) --- website/client/src/components/userMenu/profile.vue | 13 +++++-------- .../client/src/components/userMenu/profileModal.vue | 10 +++------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/website/client/src/components/userMenu/profile.vue b/website/client/src/components/userMenu/profile.vue index b270d6cf69..51818f9122 100644 --- a/website/client/src/components/userMenu/profile.vue +++ b/website/client/src/components/userMenu/profile.vue @@ -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 () { diff --git a/website/client/src/components/userMenu/profileModal.vue b/website/client/src/components/userMenu/profileModal.vue index 06b2611cc1..4ed024f163 100644 --- a/website/client/src/components/userMenu/profileModal.vue +++ b/website/client/src/components/userMenu/profileModal.vue @@ -5,7 +5,6 @@ :hide-footer="true" :hide-header="true" @hide="beforeHide" - @hidden="onHidden" @shown="onShown()" >