-
-
Save naphatamity/cb2ebc9e0720bc1e1e4548f2b615cba1 to your computer and use it in GitHub Desktop.
This file contains 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
const channelItem = ({ channelid = "channelid" }) => { | |
useEffect(() => { | |
console.log("observeMessages"); | |
observeMessages(channelid, { | |
onEvent: (action, message) => { | |
console.log("message OBserver Callds,ld,s>?:::::::"); | |
if (action === "onCreate") { | |
console.log("message>?:::::::", JSON.stringify(message), action); | |
//dispatch({notifyOnNewMessageSent(message.data)}); | |
if (message.data?.type == "image" && message.data?.editedAt) { | |
console.log("message.data?.type == image", JSON.stringify(message)); | |
} else if (message.data?.type !== "image" && message.data?.editedAt) { | |
console.log( | |
"message.data?.type !== image", | |
JSON.stringify(message) | |
); | |
} | |
console.log("DONE", JSON.stringify(message)); | |
} | |
}, | |
}); | |
}, [channelid]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment