diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2023-05-04 09:39:03 +0200 |
---|---|---|
committer | Maksim Sukharev <antreesy.web@gmail.com> | 2023-05-08 17:31:38 +0200 |
commit | 887c2a03c9d7cc52edfcbc92057feb37aa95e705 (patch) | |
tree | d151dac3bb19ace881857d7f99a019c1376e85d4 /src/components/NewMessageForm/NewMessageForm.vue | |
parent | 7f51262ce668d95543cb3a6461588234413496e5 (diff) |
connect signaling
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Diffstat (limited to 'src/components/NewMessageForm/NewMessageForm.vue')
-rw-r--r-- | src/components/NewMessageForm/NewMessageForm.vue | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/components/NewMessageForm/NewMessageForm.vue b/src/components/NewMessageForm/NewMessageForm.vue index 4f42dd537..13cfd396e 100644 --- a/src/components/NewMessageForm/NewMessageForm.vue +++ b/src/components/NewMessageForm/NewMessageForm.vue @@ -368,6 +368,7 @@ export default { checked: -1, userData: {}, clipboardTimeStamp: null, + typingTimeout: null, } }, @@ -506,6 +507,18 @@ export default { text(newValue) { this.$store.dispatch('setCurrentMessageInput', { token: this.token, text: newValue }) + + clearTimeout(this.typingTimeout) + + if (!newValue) { + this.$store.dispatch('setTyping', { typing: false }) + return + } + + this.typingTimeout = setTimeout(() => { + this.$store.dispatch('setTyping', { typing: false }) + }, 5000) + this.$store.dispatch('setTyping', { typing: true }) }, token(token) { @@ -514,6 +527,7 @@ export default { } else { this.text = '' } + this.$store.dispatch('setTyping', { typing: false }) }, showTextFileDialog(newValue) { |