Fix relay signal indicator, properly show how many relays you are connected to

Changelog-Fixed: Fix relay signal indicator, properly show how many relays you are connected to
This commit is contained in:
William Casarin
2023-04-14 11:45:10 -07:00
parent 735376b00f
commit a4d4954abd
5 changed files with 50 additions and 15 deletions

View File

@@ -52,6 +52,10 @@ class RelayPool {
var num_connecting: Int {
return relays.reduce(0) { n, r in n + (r.connection.isConnecting ? 1 : 0) }
}
var num_connected: Int {
return relays.reduce(0) { n, r in n + (r.connection.isConnected ? 1 : 0) }
}
func remove_handler(sub_id: String) {
self.handlers = handlers.filter { $0.sub_id != sub_id }