Reconnect if necessary on profile save

Fixes #759
This commit is contained in:
Davide 2024-10-26 21:09:30 +02:00
parent b36189c5c9
commit d1b41a6615
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
1 changed files with 8 additions and 0 deletions

View File

@ -111,10 +111,18 @@ private extension AppContext {
return
}
Task {
guard [.active, .activating].contains(tunnel.status) else {
return
}
if profile.isInteractive {
try await tunnel.disconnect()
return
}
do {
try await tunnel.connect(with: profile, processor: profileProcessor)
} catch {
try await tunnel.disconnect()
}
}
}
}