Only process message with a clock

It may be better to use the timestamp on Waku Message than the Chat
Message clock:
https://github.com/status-im/dappconnect-chat-sdk/issues/5#issuecomment-935322419
This commit is contained in:
Franck Royer 2021-10-06 14:14:40 +11:00
parent db7fa52fa9
commit 7ccc333757
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ export function useMessenger(chatId: string, chatIdList: string[]) {
const addNewMessage = useCallback(
(msg: ApplicationMetadataMessage, id: string) => {
if (msg.signer && msg.chatMessage?.text) {
if (msg.signer && msg.chatMessage?.text && msg.chatMessage.clock) {
const content = msg.chatMessage.text;
const date = new Date(msg.chatMessage.clock);
addNewMessageRaw(msg.signer, content, date, id);