Add icon show last reply is from agent on conversation list #997

This commit is contained in:
Nithin David Thomas 2020-07-03 23:25:33 +05:30 committed by GitHub
parent 1b1deb9626
commit bd87927576
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -78,6 +78,11 @@
font-size: $font-size-mini;
vertical-align: top;
}
.message-from-agent {
color: $color-gray;
font-size: $font-size-mini;
}
}
.conversation--meta {

View file

@ -24,6 +24,7 @@
</span>
</h4>
<p v-if="lastMessageInChat" class="conversation--message">
<i v-if="messageByAgent" class="ion-ios-undo message-from-agent"></i>
<span v-if="lastMessageInChat.content">
{{ lastMessageInChat.content }}
</span>
@ -44,6 +45,8 @@
</template>
<script>
import { mapGetters } from 'vuex';
import { MESSAGE_TYPE } from 'widget/helpers/constants';
import Thumbnail from '../Thumbnail';
import conversationMixin from '../../../mixins/conversations';
import timeMixin from '../../../mixins/time';
@ -115,6 +118,12 @@ export default {
lastMessageInChat() {
return this.lastMessage(this.chat);
},
messageByAgent() {
const lastMessage = this.lastMessageInChat;
const { message_type: messageType } = lastMessage;
return messageType === MESSAGE_TYPE.OUTGOING;
},
},
methods: {