Skip to content

Commit 47c8133

Browse files
committed
(fix) allow currentUserId number type
1 parent d3e9573 commit 47c8133

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ You can import it as a custom component:
7070
return {
7171
rooms: [],
7272
messages: [],
73-
currentUserId: '1234'
73+
currentUserId: 1234
7474
}
7575
}
7676
}
@@ -79,23 +79,23 @@ You can import it as a custom component:
7979

8080
## Props API
8181

82-
| Prop | Type | Required | Default |
83-
| ------------------ | ------- | -------- | ------- |
84-
| height | String | - | 600px |
85-
| currentUserId (1) | String | true | - |
86-
| rooms | Array | - | [ ] |
87-
| loadingRooms (2) | Boolean | - | false |
88-
| messages | Array | - | [ ] |
89-
| messagesLoaded (3) | Boolean | - | false |
90-
| menuActions (4) | Array | - | [ ] |
91-
| messageActions (5) | Array | - | (4) |
92-
| showAddRoom | Boolean | - | true |
93-
| showFiles | Boolean | - | true |
94-
| showEmojis | Boolean | - | true |
95-
| showReactionEmojis | Boolean | - | true |
96-
| textMessages (6) | Object | - | null |
97-
| theme (7) | Sring | - | light |
98-
| colors (8) | Object | - | (8) |
82+
| Prop | Type | Required | Default |
83+
| ------------------ | ---------------- | -------- | ------- |
84+
| height | String | - | 600px |
85+
| currentUserId (1) | [String, Number] | true | - |
86+
| rooms | Array | - | [ ] |
87+
| loadingRooms (2) | Boolean | - | false |
88+
| messages | Array | - | [ ] |
89+
| messagesLoaded (3) | Boolean | - | false |
90+
| menuActions (4) | Array | - | [ ] |
91+
| messageActions (5) | Array | - | (4) |
92+
| showAddRoom | Boolean | - | true |
93+
| showFiles | Boolean | - | true |
94+
| showEmojis | Boolean | - | true |
95+
| showReactionEmojis | Boolean | - | true |
96+
| textMessages (6) | Object | - | null |
97+
| theme (7) | Sring | - | light |
98+
| colors (8) | Object | - | (8) |
9999

100100
(1) `currentUserId` is required to display UI and trigger actions according to the user using the chat (ex: messages position on the right, etc.)
101101

src/ChatWindow/ChatMessage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export default {
206206
},
207207
208208
props: {
209-
currentUserId: { type: String, required: true },
209+
currentUserId: { type: [String, Number], required: true },
210210
textMessages: { type: Object, required: true },
211211
index: { type: Number, required: true },
212212
message: { type: Object, required: true },

src/ChatWindow/ChatWindow.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default {
6161
theme: { type: String, default: 'light' },
6262
colors: { type: Object, default: null },
6363
textMessages: { type: Object, default: null },
64-
currentUserId: { type: String, default: '' },
64+
currentUserId: { type: [String, Number], default: '' },
6565
rooms: { type: Array, default: () => [] },
6666
loadingRooms: { type: Boolean, default: false },
6767
messages: { type: Array, default: () => [] },

src/ChatWindow/MessagesList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export default {
222222
},
223223
224224
props: {
225-
currentUserId: { type: String, required: true },
225+
currentUserId: { type: [String, Number], required: true },
226226
textMessages: { type: Object, required: true },
227227
showRoomsList: { type: Boolean, required: true },
228228
isMobile: { type: Boolean, required: true },

0 commit comments

Comments
 (0)