Last active
September 3, 2021 05:49
-
-
Save hieptl/2e130491c7c478da53509ca68542ff65 to your computer and use it in GitHub Desktop.
index.js - CometChatMessageList - Mention Chat App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
showToastForMentionMessage = (message) => { | |
if (message.text.includes(`@${this.state.loggedInUser.name}`)) { | |
const toastMessage = `You was tagged by ${message.sender.name}`; | |
this.context.setToastMessage("success", toastMessage); | |
} | |
} | |
//callback for listener functions | |
messageUpdated = (key, message, group, options) => { | |
... | |
case enums.TEXT_MESSAGE_RECEIVED: | |
case enums.MEDIA_MESSAGE_RECEIVED: | |
this.showToastForMentionMessage(message); | |
this.onMessageReceived(message); | |
break; | |
... | |
}; | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment