Files
habitica/website/client/components/private-message-modal.vue
Keith Holliday cdd3bc3cd6 Client fixes aug 31 (#9010)
* Separated private message model

* Added markdown to profile

* Add color backgrounds

* Added broken challenge flow

* Added summary field to getgroups

* Fixed group form information loading

* Updated autocomplete to use chat

* Fixed npc styles

* Fixed onload mentions
2017-08-31 16:14:09 -06:00

36 lines
857 B
Vue

<template lang="pug">
b-modal#private-message(title="Message", size='sm', :hide-footer="true")
textarea.form-control(v-model='privateMessage')
button.btn.btn-primary(@click='sendPrivateMessage()') Send
</template>
<script>
import bModal from 'bootstrap-vue/lib/components/modal';
import notifications from 'client/mixins/notifications';
export default {
mixins: [notifications],
props: ['userIdToMessage'],
components: {
bModal,
},
data () {
return {
privateMessage: '',
};
},
methods: {
async sendPrivateMessage () {
if (!this.privateMessage || !this.userIdToMessage) return;
await this.$store.dispatch('members:sendPrivateMessage', {
message: this.privateMessage,
toUserId: this.userIdToMessage,
});
this.text(this.$t('messageSentAlert'));
},
},
};
</script>