diff --git a/website/client/src/app.vue b/website/client/src/app.vue index 5b72ea8782..d8f561c3c3 100644 --- a/website/client/src/app.vue +++ b/website/client/src/app.vue @@ -269,6 +269,17 @@ export default { const loadingScreen = document.getElementById('loading-screen'); if (loadingScreen) document.body.removeChild(loadingScreen); + // Check if we need to show password change success message + if (sessionStorage.getItem('passwordChangeSuccess') === 'true') { + sessionStorage.removeItem('passwordChangeSuccess'); + this.$store.dispatch('snackbars:add', { + title: 'Habitica', + text: this.$t('passwordSuccess'), + type: 'success', + timeout: true, + }); + } + this.$router.onReady(() => { if (this.isStaticPage || !this.isUserLoggedIn) { this.hideLoadingScreen(); diff --git a/website/client/src/pages/settings/settingRows/passwordSetting.vue b/website/client/src/pages/settings/settingRows/passwordSetting.vue index 706cf9204b..353ba96485 100644 --- a/website/client/src/pages/settings/settingRows/passwordSetting.vue +++ b/website/client/src/pages/settings/settingRows/passwordSetting.vue @@ -168,12 +168,9 @@ export default { }); this.passwordUpdates = {}; - this.$store.dispatch('snackbars:add', { - title: 'Habitica', - text: this.$t('passwordSuccess'), - type: 'success', - timeout: true, - }); + // Store a flag to show success message after reload + sessionStorage.setItem('passwordChangeSuccess', 'true'); + window.location.reload(); }); },