Skip to content

Commit edbe8f2

Browse files
committed
(props) add user-tags-enabled & emojis-suggestion-enabled
1 parent 46b50ff commit edbe8f2

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ fetchMessages({ room, options }) {
242242
| `link-options`(16) | Object | - | `{ disabled: false, target: '_blank', rel: null }` |
243243
| `room-info-enabled` (17) | Boolean | - | `false` |
244244
| `textarea-action-enabled`(18) | Boolean | - | `false` |
245+
| `user-tags-enabled` | Boolean | - | `true` |
246+
| `emojis-suggestion-enabled` | Boolean | - | `true` |
245247
| `responsive-breakpoint`(19) | Number | - | `900` |
246248
| `single-room`(20) | Boolean | - | `false` |
247249
| `scroll-distance`(21) | Number | - | `60` |

src/lib/ChatWindow.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
:loading-rooms="loadingRooms"
5757
:room-info-enabled="roomInfoEnabled"
5858
:textarea-action-enabled="textareaActionEnabled"
59+
:user-tags-enabled="userTagsEnabled"
60+
:emojis-suggestion-enabled="emojisSuggestionEnabled"
5961
:scroll-distance="scrollDistance"
6062
:accepted-files="acceptedFiles"
6163
:templates-text="templatesText"
@@ -155,6 +157,8 @@ export default {
155157
},
156158
roomInfoEnabled: { type: Boolean, default: false },
157159
textareaActionEnabled: { type: Boolean, default: false },
160+
userTagsEnabled: { type: Boolean, default: true },
161+
emojisSuggestionEnabled: { type: Boolean, default: true },
158162
roomMessage: { type: String, default: '' },
159163
scrollDistance: { type: Number, default: 60 },
160164
acceptedFiles: { type: String, default: '*' },

src/lib/Room/Room.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ export default {
379379
loadingRooms: { type: Boolean, required: true },
380380
roomInfoEnabled: { type: Boolean, required: true },
381381
textareaActionEnabled: { type: Boolean, required: true },
382+
userTagsEnabled: { type: Boolean, required: true },
383+
emojisSuggestionEnabled: { type: Boolean, required: true },
382384
scrollDistance: { type: Number, required: true },
383385
templatesText: { type: Array, default: null }
384386
},
@@ -720,10 +722,11 @@ export default {
720722
updateFooterList(tagChar) {
721723
if (!this.getTextareaRef()) return
722724
723-
if (
724-
tagChar === '@' &&
725-
(!this.room.users || this.room.users.length <= 2)
726-
) {
725+
if (tagChar === ':' && !this.emojisSuggestionEnabled) {
726+
return
727+
}
728+
729+
if (tagChar === '@' && (!this.userTagsEnabled || !this.room.users)) {
727730
return
728731
}
729732

0 commit comments

Comments
 (0)