mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
* Added hover state to buy buttons * Translated profile * Fixed sending private message from member modal * Added payment functions * Added translation to home page * Fixed translation * Some front page styles * Fixed inbox sorting and searching * Added seasonals * Fixed buy gem modal conflict * Fixed paypal link * Fixed footer style crossover * Fixed quest update * Fixed sanity
64 lines
1.3 KiB
Vue
64 lines
1.3 KiB
Vue
<template lang="pug">
|
|
b-modal#private-message(title="Message", size='md', :hide-footer="true")
|
|
.content
|
|
textarea.form-control(v-model='privateMessage')
|
|
button.btn.btn-primary(@click='sendPrivateMessage()', :disabled='loading') Send
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
.content {
|
|
padding: 1em;
|
|
|
|
textarea {
|
|
margin-bottom: 1em;
|
|
}
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
import bModal from 'bootstrap-vue/lib/components/modal';
|
|
import notifications from 'client/mixins/notifications';
|
|
|
|
export default {
|
|
mixins: [notifications],
|
|
components: {
|
|
bModal,
|
|
},
|
|
data () {
|
|
return {
|
|
privateMessage: '',
|
|
loading: false,
|
|
userIdToMessage: '',
|
|
};
|
|
},
|
|
computed: {
|
|
userIdToMessageStore () {
|
|
return this.$store.state.userIdToMessage;
|
|
},
|
|
},
|
|
watch: {
|
|
userIdToMessageStore () {
|
|
this.userIdToMessage = this.userIdToMessageStore;
|
|
},
|
|
},
|
|
methods: {
|
|
async sendPrivateMessage () {
|
|
if (!this.privateMessage || !this.userIdToMessage) return;
|
|
|
|
this.loading = true;
|
|
|
|
await this.$store.dispatch('members:sendPrivateMessage', {
|
|
message: this.privateMessage,
|
|
toUserId: this.userIdToMessage,
|
|
});
|
|
|
|
this.loading = false;
|
|
|
|
this.text(this.$t('messageSentAlert'));
|
|
|
|
this.privateMessage = '';
|
|
},
|
|
},
|
|
};
|
|
</script>
|