Skip to content

Commit

Permalink
fix bug on example
Browse files Browse the repository at this point in the history
  • Loading branch information
d-roak committed Jun 24, 2024
1 parent 57a7e06 commit 01ab5d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/canvas/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const render = () => {
);
object_element.innerHTML = "[" + objectPeers.join(", ") + "]";

if (!canvasCRO) return;
const canvas = canvasCRO.canvas;
const canvas_element = <HTMLDivElement>document.getElementById("canvas");
canvas_element.innerHTML = "";
Expand Down Expand Up @@ -73,7 +74,9 @@ async function init() {
handleCanvasMessages(canvasCRO, e);
peers = node.getPeers();
discoveryPeers = node.getPeersPerGroup("_peer-discovery._p2p._pubsub");
objectPeers = node.getPeersPerGroup(canvasCRO.getObjectId());
if (canvasCRO) {
objectPeers = node.getPeersPerGroup(canvasCRO.getObjectId());
}
render();
});

Expand Down

0 comments on commit 01ab5d3

Please sign in to comment.