Improve logging upon receiving messages

This commit is contained in:
Franck Royer 2021-07-02 10:54:56 +10:00
parent 3c618f435e
commit f020aa7a8c
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 2 additions and 1 deletions

View File

@ -119,6 +119,7 @@ function handlePublicKeyMessage(
setter: Dispatch<SetStateAction<Map<string, string>>>,
msg: WakuMessage
) {
console.log('Public Key Message received:', msg);
if (!msg.payload) return;
const publicKeyMsg = PublicKeyMessage.decode(msg.payload);
if (!publicKeyMsg) return;
@ -140,7 +141,7 @@ async function handleDirectMessage(
address: string,
wakuMsg: WakuMessage
) {
console.log('Waku Message received:', wakuMsg);
console.log('Direct Message received:', wakuMsg);
if (!wakuMsg.payload) return;
const directMessage: DirectMessage = decode(wakuMsg.payload);
if (directMessage.toAddress !== address) return;