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:
parent
db7fa52fa9
commit
7ccc333757
|
@ -74,7 +74,7 @@ export function useMessenger(chatId: string, chatIdList: string[]) {
|
||||||
|
|
||||||
const addNewMessage = useCallback(
|
const addNewMessage = useCallback(
|
||||||
(msg: ApplicationMetadataMessage, id: string) => {
|
(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 content = msg.chatMessage.text;
|
||||||
const date = new Date(msg.chatMessage.clock);
|
const date = new Date(msg.chatMessage.clock);
|
||||||
addNewMessageRaw(msg.signer, content, date, id);
|
addNewMessageRaw(msg.signer, content, date, id);
|
||||||
|
|
Loading…
Reference in New Issue