Skip to content

Commit

Permalink
Merge pull request #51 from Grizzelbee/development
Browse files Browse the repository at this point in the history
fixed connected peers counter
  • Loading branch information
Grizzelbee committed Oct 26, 2022
2 parents f742a31 + a6b7050 commit 3309743
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,15 @@ function setConnectedState(path, value) {
}
}, value);
if (value){
if (!connectedPeers.includes(path.split('.', 5).pop()) ){
connectedPeers.push(path.split('.', 5).pop());
const item = path.split('.', 5).pop();
if (!connectedPeers.includes(item) ){
connectedPeers.push(item);
}
} else {
const item = path.split('.', 5).pop();
if (!connectedPeers.includes(item) ){
const index = connectedPeers.indexOf(item);
connectedPeers.splice(index, 1);
}
}
createOrExtendObject(`${path}.isSuspended`, {
Expand Down

0 comments on commit 3309743

Please sign in to comment.