Skip to content

Commit 6ec4cbd

Browse files
committed
(docs) add message data to messageActionHandler
1 parent 2fe5707 commit 6ec4cbd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ messages="[
404404
| openFile | `{ message }` | A user has clicked to view or download a file |
405405
| addRoom | - | A user clicks on the plus icon next to searchbar |
406406
| menuActionHandler (2) | `{ roomId, action }` | A user clicks on the vertical dots icon inside a room |
407-
| messageActionHandler (3) | `{ roomId, action }` | A user clicks on the dropdown icon inside a message |
407+
| messageActionHandler (3) | `{ roomId, action, message }` | A user clicks on the dropdown icon inside a message |
408408
| sendMessageReaction | `{ roomId, messageId, reaction, remove }` | A user clicks on the emoji icon inside a message |
409409
| typingMessage | `{ message, roomId }` | A user is typing a message |
410410

@@ -430,11 +430,11 @@ menuActionHandler({ roomId, action }) {
430430
```
431431

432432
(3) `messageActionHandler` is the result of the `messageActions` prop.<br>
433-
When clicking a button from your `messageActions` array, `messageActionHandler` will give you the name of the button that was click.
433+
When clicking a message menu button from your `messageActions` array, `messageActionHandler` will give you the name of the button that was click and the corresponding message data.
434434
Then you can do whatever you want with it. Ex:
435435

436436
```javascript
437-
messageActionHandler({ roomId, action }) {
437+
messageActionHandler({ roomId, action, message }) {
438438
switch (action.name) {
439439
case 'addMessageToFavorite':
440440
// call a method to add a message to the favorite list

0 commit comments

Comments
 (0)