Skip to content

Commit ab17959

Browse files
committed
(fix) show user tags only for groups
1 parent 6ee6587 commit ab17959

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/ChatWindow/Room.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,7 @@ export default {
466466
})
467467
468468
this.$refs['roomTextarea'].addEventListener('blur', () => {
469-
this.filteredUsersTag = []
470-
this.textareaCursorPosition = null
469+
this.resetUsersTag()
471470
if (isMobile) setTimeout(() => (this.keepKeyboardOpen = false), 0)
472471
})
473472
@@ -587,7 +586,7 @@ export default {
587586
588587
methods: {
589588
updateShowUsersTag() {
590-
if (this.$refs['roomTextarea']) {
589+
if (this.$refs['roomTextarea'] && this.room.users.length > 2) {
591590
if (
592591
this.textareaCursorPosition ===
593592
this.$refs['roomTextarea'].selectionStart
@@ -621,10 +620,9 @@ export default {
621620
'username',
622621
query,
623622
true
624-
)
623+
).filter(user => user._id !== this.currentUserId)
625624
} else {
626-
this.filteredUsersTag = []
627-
this.textareaCursorPosition = null
625+
this.resetUsersTag()
628626
}
629627
}
630628
},
@@ -635,6 +633,10 @@ export default {
635633
user.username +
636634
this.message.substr(cursorPosition + 1)
637635
},
636+
resetUsersTag() {
637+
this.filteredUsersTag = []
638+
this.textareaCursorPosition = null
639+
},
638640
onImgLoad() {
639641
let height = this.$refs.imageFile.height
640642
if (height < 30) height = 30
@@ -727,6 +729,7 @@ export default {
727729
return
728730
}
729731
732+
this.resetUsersTag()
730733
this.resetTextareaSize()
731734
this.message = ''
732735
this.editedMessage = {}

0 commit comments

Comments
 (0)