diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2021-02-20 20:20:05 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2021-02-20 20:20:05 +0900 |
| commit | 25d37302a8bfda954c7ede1e9d355db587c82228 (patch) | |
| tree | 8d2eff01cc738a84776976d36cabc8a143b40798 /src/client/components | |
| parent | Improve usability (diff) | |
| download | sharkey-25d37302a8bfda954c7ede1e9d355db587c82228.tar.gz sharkey-25d37302a8bfda954c7ede1e9d355db587c82228.tar.bz2 sharkey-25d37302a8bfda954c7ede1e9d355db587c82228.zip | |
チャンネルで入力中ユーザーを表示するように、Chat UIでタイムラインでは投稿フォームを上に表示するように
Diffstat (limited to 'src/client/components')
| -rw-r--r-- | src/client/components/post-form.vue | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/components/post-form.vue b/src/client/components/post-form.vue index fa9aeff8af..7849095ba8 100644 --- a/src/client/components/post-form.vue +++ b/src/client/components/post-form.vue @@ -70,6 +70,7 @@ import * as os from '@/os'; import { selectFile } from '@/scripts/select-file'; import { notePostInterruptors, postFormActions } from '@/store'; import { isMobile } from '@/scripts/is-mobile'; +import { throttle } from 'throttle-debounce'; export default defineComponent({ components: { @@ -144,6 +145,11 @@ export default defineComponent({ quoteId: null, recentHashtags: JSON.parse(localStorage.getItem('hashtags') || '[]'), imeText: '', + typing: throttle(3000, () => { + if (this.channel) { + os.stream.send('typingOnChannel', { channel: this.channel.id }); + } + }), postFormActions, faReply, faQuoteRight, faPaperPlane, faTimes, faUpload, faPollH, faGlobe, faHome, faUnlock, faEnvelope, faEyeSlash, faLaughSquint, faPlus, faPhotoVideo, faAt, faBiohazard, faPlug }; @@ -434,10 +440,12 @@ export default defineComponent({ onKeydown(e: KeyboardEvent) { if ((e.which === 10 || e.which === 13) && (e.ctrlKey || e.metaKey) && this.canPost) this.post(); if (e.which === 27) this.$emit('esc'); + this.typing(); }, onCompositionUpdate(e: CompositionEvent) { this.imeText = e.data; + this.typing(); }, onCompositionEnd(e: CompositionEvent) { |