Opps i had array of arrays of peers in message json

This commit is contained in:
MrMasrozYTLIVE 2024-06-10 17:55:23 +03:00
parent 2ed13e50f7
commit 051aa09c2d

2
app.js
View File

@ -297,7 +297,7 @@ function sendMessage(e) {
onMessageAdded(config.userName, message, config.userAvatar); onMessageAdded(config.userName, message, config.userAvatar);
let peersPublicKeys = []; let peersPublicKeys = [];
peersPublicKeys.push([...swarm.connections].map(peer => peer.remotePublicKey.toString('hex'))); peersPublicKeys.push([...swarm.connections].map(peer => peer.remotePublicKey.toString('hex')).flat(1));
peersPublicKeys.push(swarm.keyPair.publicKey.toString('hex')); peersPublicKeys.push(swarm.keyPair.publicKey.toString('hex'));
const messageObj = JSON.stringify({ const messageObj = JSON.stringify({