Trying to fix peer counts

This commit is contained in:
Raven Scott 2024-06-08 15:52:44 -04:00
parent 8c54e4ca77
commit ac2da1524d

2
app.js
View File

@ -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);
});
});