mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-06-24 00:51:43 +00:00
fixed typing status not working
This commit is contained in:
parent
e5da9a0063
commit
dc43f9017f
1 changed files with 8 additions and 6 deletions
|
|
@ -15,6 +15,7 @@
|
||||||
selectedChannelID ? channelName : `Welcome back, ${user.username}!`
|
selectedChannelID ? channelName : `Welcome back, ${user.username}!`
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
{{typingRecipients}}
|
||||||
<div class="loading" v-if="selectedChannelID && !selectedChannelMessages">
|
<div class="loading" v-if="selectedChannelID && !selectedChannelMessages">
|
||||||
<spinner />
|
<spinner />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -627,10 +628,8 @@ export default {
|
||||||
onBlur() {
|
onBlur() {
|
||||||
clearTimeout(this.postTimerID);
|
clearTimeout(this.postTimerID);
|
||||||
this.postTimerID = null;
|
this.postTimerID = null;
|
||||||
}
|
},
|
||||||
},
|
onTyping(data) {
|
||||||
mounted() {
|
|
||||||
this.$options.sockets.typingStatus = data => {
|
|
||||||
const { channel_id, user } = data;
|
const { channel_id, user } = data;
|
||||||
const typingRecipients = this.typingRecipients[channel_id];
|
const typingRecipients = this.typingRecipients[channel_id];
|
||||||
|
|
||||||
|
|
@ -657,7 +656,10 @@ export default {
|
||||||
},
|
},
|
||||||
3500
|
3500
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$socket.client.on("typingStatus", this.onTyping);
|
||||||
|
|
||||||
bus.$on("newMessage", this.hideTypingStatus);
|
bus.$on("newMessage", this.hideTypingStatus);
|
||||||
bus.$on("emojiSuggestions:Selected", this.enterEmojiSuggestion);
|
bus.$on("emojiSuggestions:Selected", this.enterEmojiSuggestion);
|
||||||
|
|
@ -681,7 +683,7 @@ export default {
|
||||||
window.removeEventListener("focus", this.onFocus);
|
window.removeEventListener("focus", this.onFocus);
|
||||||
window.removeEventListener("blur", this.onBlur);
|
window.removeEventListener("blur", this.onBlur);
|
||||||
|
|
||||||
delete this.$options.sockets.typingStatus;
|
this.$socket.client.off("typingStatus", this.onTyping);
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
editMessage(editMessage) {
|
editMessage(editMessage) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue