From ac2da1524df9869f50c75233a7052321f0c64633 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Sat, 8 Jun 2024 15:52:44 -0400 Subject: [PATCH] Trying to fix peer counts --- app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index e872a12..30eea35 100644 --- a/app.js +++ b/app.js @@ -67,6 +67,7 @@ async function initialize() { swarm.on('connection', async (connection, info) => { peerCount++; updatePeerCount(); + console.log('Peer connected, current peer count:', peerCount); // Send the current user's icon to the new peer const iconBuffer = await drive.get(`/icons/${userName}.png`); @@ -94,6 +95,7 @@ async function initialize() { connection.on('close', () => { peerCount--; updatePeerCount(); + console.log('Peer disconnected, current peer count:', peerCount); }); }); @@ -301,4 +303,4 @@ function toggleSetupView() { setupDiv.classList.toggle('hidden'); } -initialize(); \ No newline at end of file +initialize();