mirror of
https://github.com/logos-messaging/examples.waku.org.git
synced 2026-01-04 05:43:07 +00:00
fix import
This commit is contained in:
parent
774abec351
commit
20538d471c
@ -47,7 +47,8 @@
|
|||||||
waitForRemotePeer,
|
waitForRemotePeer,
|
||||||
createEncoder,
|
createEncoder,
|
||||||
createDecoder,
|
createDecoder,
|
||||||
utils,
|
utf8ToBytes,
|
||||||
|
bytesToUtf8,
|
||||||
} from "https://unpkg.com/@waku/sdk@0.0.16/bundle/index.js";
|
} from "https://unpkg.com/@waku/sdk@0.0.16/bundle/index.js";
|
||||||
|
|
||||||
const peerIdDiv = document.getElementById("peer-id");
|
const peerIdDiv = document.getElementById("peer-id");
|
||||||
@ -101,7 +102,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const callback = (wakuMessage) => {
|
const callback = (wakuMessage) => {
|
||||||
const text = utils.bytesToUtf8(wakuMessage.payload);
|
const text = bytesToUtf8(wakuMessage.payload);
|
||||||
const timestamp = wakuMessage.timestamp.toString();
|
const timestamp = wakuMessage.timestamp.toString();
|
||||||
messages.push(text + " - " + timestamp);
|
messages.push(text + " - " + timestamp);
|
||||||
updateMessages(messages, messagesDiv);
|
updateMessages(messages, messagesDiv);
|
||||||
@ -124,7 +125,7 @@
|
|||||||
const text = textInput.value;
|
const text = textInput.value;
|
||||||
|
|
||||||
await node.lightPush.send(encoder, {
|
await node.lightPush.send(encoder, {
|
||||||
payload: utils.utf8ToBytes(text),
|
payload: utf8ToBytes(text),
|
||||||
});
|
});
|
||||||
console.log("Message sent!");
|
console.log("Message sent!");
|
||||||
textInput.value = null;
|
textInput.value = null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user