diff --git a/Passepartout/Library/Sources/AppUI/Business/AppContext.swift b/Passepartout/Library/Sources/AppUI/Business/AppContext.swift index ee6e194c..735e1fb6 100644 --- a/Passepartout/Library/Sources/AppUI/Business/AppContext.swift +++ b/Passepartout/Library/Sources/AppUI/Business/AppContext.swift @@ -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() + } } } }