diff --git a/website/client/components/chat/chatMessages.vue b/website/client/components/chat/chatMessages.vue index da3c2c2944..176106f32a 100644 --- a/website/client/components/chat/chatMessages.vue +++ b/website/client/components/chat/chatMessages.vue @@ -478,10 +478,10 @@ export default { // Open the modal only if the data is available if (profile && !profile.rejected) { - // @TODO move to action or anyway move from here because it's super duplicate - this.$store.state.profileUser = profile; - this.$store.state.profileOptions.startingPage = 'profile'; - this.$root.$emit('bv::show::modal', 'profile'); + this.$root.$emit('habitica:show-profile', { + user: profile, + startingPage: 'profile', + }); } }, }, diff --git a/website/client/components/groups/group.vue b/website/client/components/groups/group.vue index 357388dbe9..b71738411d 100644 --- a/website/client/components/groups/group.vue +++ b/website/client/components/groups/group.vue @@ -869,9 +869,10 @@ export default { }, async showMemberProfile (leader) { let heroDetails = await this.$store.dispatch('members:fetchMember', { memberId: leader._id }); - this.$store.state.profileUser = heroDetails.data.data; - this.$store.state.profileOptions.startingPage = 'profile'; - this.$root.$emit('bv::show::modal', 'profile'); + this.$root.$emit('habitica:show-profile', { + user: heroDetails.data.data, + startingPage: 'profile', + }); }, async questAbort () { if (!confirm(this.$t('sureAbort'))) return; diff --git a/website/client/components/hall/heroes.vue b/website/client/components/hall/heroes.vue index 732594f206..3222483668 100644 --- a/website/client/components/hall/heroes.vue +++ b/website/client/components/hall/heroes.vue @@ -199,9 +199,10 @@ export default { }, async clickMember (hero) { let heroDetails = await this.$store.dispatch('members:fetchMember', { memberId: hero._id }); - this.$store.state.profileUser = heroDetails.data.data; - this.$store.state.profileOptions.startingPage = 'profile'; - this.$root.$emit('bv::show::modal', 'profile'); + this.$root.$emit('habitica:show-profile', { + user: heroDetails.data.data, + startingPage: 'profile', + }); }, userLevelStyle () { // @TODO: implement diff --git a/website/client/components/header/notificationsDropdown.vue b/website/client/components/header/notificationsDropdown.vue index 4bbd1ae313..00150869f0 100644 --- a/website/client/components/header/notificationsDropdown.vue +++ b/website/client/components/header/notificationsDropdown.vue @@ -34,7 +34,7 @@ menu-dropdown.item-notifications(:right="true") button.btn.btn-primary(@click.stop='accept(guild, index, "guild")') Accept button.btn.btn-primary(@click.stop='reject(guild, index, "guild")') Reject a.dropdown-item(v-if='user.flags.classSelected && !user.preferences.disableClasses && user.stats.points', - @click='go("/user/profile")') + @click='showProfile()') span.glyphicon.glyphicon-plus-sign span {{ $t('haveUnallocated', {points: user.stats.points}) }} a.dropdown-item(v-for='message in userNewMessages') @@ -279,6 +279,12 @@ export default { let quest = await this.$store.dispatch('quests:sendAction', {groupId: partyId, action: 'quests/reject'}); this.user.party.quest = quest; }, + showProfile () { + this.$root.$emit('habitica:show-profile', { + user: this.user, + startingPage: 'stats', + }); + }, }, }; diff --git a/website/client/components/header/userDropdown.vue b/website/client/components/header/userDropdown.vue index 60ead51a3a..121754e775 100644 --- a/website/client/components/header/userDropdown.vue +++ b/website/client/components/header/userDropdown.vue @@ -98,9 +98,10 @@ export default { this.$root.$emit('bv::show::modal', 'inbox-modal'); }, showProfile (startingPage) { - this.$store.state.profileUser = this.user; - this.$store.state.profileOptions.startingPage = startingPage; - this.$root.$emit('bv::show::modal', 'profile'); + this.$root.$emit('habitica:show-profile', { + user: this.user, + startingPage, + }); }, showBuyGemsModal (startingPage) { this.$store.state.gemModalOptions.startingPage = startingPage; diff --git a/website/client/components/memberDetails.vue b/website/client/components/memberDetails.vue index 8e8644c50d..e265baa58f 100644 --- a/website/client/components/memberDetails.vue +++ b/website/client/components/memberDetails.vue @@ -1,6 +1,6 @@