fix import

This commit is contained in:
Sasha 2023-06-20 00:58:39 +02:00
parent 774abec351
commit 20538d471c
No known key found for this signature in database

View File

@ -47,7 +47,8 @@
waitForRemotePeer,
createEncoder,
createDecoder,
utils,
utf8ToBytes,
bytesToUtf8,
} from "https://unpkg.com/@waku/sdk@0.0.16/bundle/index.js";
const peerIdDiv = document.getElementById("peer-id");
@ -101,7 +102,7 @@
};
const callback = (wakuMessage) => {
const text = utils.bytesToUtf8(wakuMessage.payload);
const text = bytesToUtf8(wakuMessage.payload);
const timestamp = wakuMessage.timestamp.toString();
messages.push(text + " - " + timestamp);
updateMessages(messages, messagesDiv);
@ -124,7 +125,7 @@
const text = textInput.value;
await node.lightPush.send(encoder, {
payload: utils.utf8ToBytes(text),
payload: utf8ToBytes(text),
});
console.log("Message sent!");
textInput.value = null;