After add listener automatically trigger peer list change event (#1044)

In case of alway-on start the peer list was invalid on Android UI.
This commit is contained in:
Zoltan Papp
2023-08-04 14:14:08 +02:00
committed by GitHub
parent 0fc6c477a9
commit a0a6ced148
2 changed files with 8 additions and 1 deletions

View File

@@ -353,9 +353,13 @@ func (d *Status) onConnectionChanged() {
}
func (d *Status) notifyPeerListChanged() {
d.notifier.peerListChanged(len(d.peers) + len(d.offlinePeers))
d.notifier.peerListChanged(d.numOfPeers())
}
func (d *Status) notifyAddressChanged() {
d.notifier.localAddressChanged(d.localPeer.FQDN, d.localPeer.IP)
}
func (d *Status) numOfPeers() int {
return len(d.peers) + len(d.offlinePeers)
}