From 2e05bc9e682396612b30ee1aa979b381b44c4b9c Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Tue, 7 Jan 2020 13:10:59 +0300 Subject: [PATCH] fix(gui): connection status fix detection in some situations --- src/background/p2p.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/background/p2p.js b/src/background/p2p.js index f14e1f7..1481ac0 100644 --- a/src/background/p2p.js +++ b/src/background/p2p.js @@ -160,6 +160,13 @@ class p2p { { data.peers.forEach(peer => this.add(peer)) } + + // someone connected to our server, make sure that status updated properly + if (this.p2pStatus === 0) { + // switch to direct status, otherwise it's relay + this.p2pStatus = 2 + this.send('p2pStatus', this.p2pStatus) + } }) // new peer with peer exchange