Changed private message" button to use <a href> to open Private Messa… (#12010)

* Changed private message" button to use <a href> to open Private Message page in same tab.

Changed private message" button to use <a href> to open Private Message page in same tab with normal mouse click, and open in a new tab with right mouse click mouse context menu.

* Use router-link and navigation guard as requested.

Change from <a href to router-link in profile.vue and use navigation guard to obtain selected user data from server instead of doing so in mount method as requested.

* Added habitica::dismiss-modal to hide members modal

* Suggestion from lint

* Use replace in router-link to as per suggestion

* Suggestion by lint

* Remove sendMessage function in profile.vue as suggested in PR review
This commit is contained in:
tsukimi2
2020-05-05 22:14:31 +08:00
committed by GitHub
parent f60b50d6fa
commit 378325a8a2
2 changed files with 34 additions and 18 deletions

View File

@@ -5,16 +5,20 @@
>
<div class="header">
<div class="profile-actions">
<button
v-b-tooltip.hover.left="$t('sendMessage')"
class="btn btn-secondary message-icon"
@click="sendMessage()"
<router-link
:to="{ path: '/private-messages', query: { uuid: user._id } }"
replace
>
<div
class="svg-icon message-icon"
v-html="icons.message"
></div>
</button>
<button
v-b-tooltip.hover.left="$t('sendMessage')"
class="btn btn-secondary message-icon"
>
<div
class="svg-icon message-icon"
v-html="icons.message"
></div>
</button>
</router-link>
<button
v-b-tooltip.hover.bottom="$t('sendGems')"
class="btn btn-secondary gift-icon"
@@ -858,14 +862,6 @@ export default {
this.selectedPage = page || 'profile';
window.history.replaceState(null, null, '');
},
sendMessage () {
this.$store.dispatch('user:newPrivateMessageTo', {
member: this.user,
});
this.$router.push('/private-messages');
this.$root.$emit('bv::hide::modal', 'profile');
},
getProgressDisplay () {
// let currentLoginDay = Content.loginIncentives[this.user.loginIncentives];
// if (!currentLoginDay) return this.$t('checkinReceivedAllRewardsMessage');