mirror of
https://github.com/yggdrasil-network/yggdrasil-ios.git
synced 2025-04-28 22:25:10 +03:00
Tweaks
This commit is contained in:
parent
0bea3a1613
commit
1b9e84d056
9 changed files with 234 additions and 137 deletions
|
@ -72,7 +72,7 @@ class CrossPlatformAppDelegate: PlatformAppDelegate, ObservableObject {
|
|||
@Published var yggdrasilIP: String = "N/A"
|
||||
@Published var yggdrasilSubnet: String = "N/A"
|
||||
@Published var yggdrasilCoords: String = "[]"
|
||||
|
||||
|
||||
@Published var yggdrasilPeers: [YggdrasilPeer] = []
|
||||
|
||||
func yggdrasilVersion() -> String {
|
||||
|
@ -108,11 +108,12 @@ class CrossPlatformAppDelegate: PlatformAppDelegate, ObservableObject {
|
|||
func becameBackground() {}
|
||||
|
||||
func updateStatus(conn: NEVPNConnection) {
|
||||
if conn.status == .connected {
|
||||
if conn.status == .connected || conn.status == .connecting {
|
||||
self.yggdrasilEnabled = true
|
||||
self.requestSummaryIPC()
|
||||
} else if conn.status == .disconnecting || conn.status == .disconnected {
|
||||
self.clearStatus()
|
||||
self.yggdrasilEnabled = false
|
||||
self.clearStatus()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,6 +189,8 @@ class CrossPlatformAppDelegate: PlatformAppDelegate, ObservableObject {
|
|||
self.yggdrasilPublicKey = summary.publicKey
|
||||
self.yggdrasilPeers = summary.peers
|
||||
self.yggdrasilConnected = summary.peers.filter { $0.up }.count > 0
|
||||
|
||||
print("Response: \(String(data: js, encoding: .utf8))")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue