Feature: Typing Indicator on widget and dashboard (#811)
* Adds typing indicator for widget * typing indicator for agents in dashboard Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
committed by
GitHub
parent
fabc3170b7
commit
5bc8219db5
@@ -20,8 +20,8 @@
|
||||
class="input"
|
||||
type="text"
|
||||
:placeholder="$t(messagePlaceHolder())"
|
||||
@click="onClick()"
|
||||
@blur="onBlur()"
|
||||
@focus="onFocus"
|
||||
@blur="onBlur"
|
||||
/>
|
||||
<file-upload
|
||||
v-if="showFileUpload"
|
||||
@@ -260,25 +260,16 @@ export default {
|
||||
onBlur() {
|
||||
this.toggleTyping('off');
|
||||
},
|
||||
onClick() {
|
||||
this.markSeen();
|
||||
onFocus() {
|
||||
this.toggleTyping('on');
|
||||
},
|
||||
markSeen() {
|
||||
if (this.channelType === 'Channel::FacebookPage') {
|
||||
this.$store.dispatch('markSeen', {
|
||||
inboxId: this.currentChat.inbox_id,
|
||||
contactId: this.currentChat.meta.sender.id,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
toggleTyping(status) {
|
||||
if (this.channelType === 'Channel::FacebookPage') {
|
||||
if (this.channelType === 'Channel::WebWidget' && !this.isPrivate) {
|
||||
const conversationId = this.currentChat.id;
|
||||
this.$store.dispatch('toggleTyping', {
|
||||
status,
|
||||
inboxId: this.currentChat.inbox_id,
|
||||
contactId: this.currentChat.meta.sender.id,
|
||||
conversationId,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user