Improve service stop
This commit is contained in:
@@ -98,7 +98,7 @@ public struct OverviewView: View {
|
||||
}
|
||||
|
||||
private nonisolated func serviceReload() async throws {
|
||||
try LibboxNewStandaloneCommandClient()?.serviceReload()
|
||||
try LibboxNewStandaloneCommandClient()!.serviceReload()
|
||||
}
|
||||
|
||||
private nonisolated func setSystemProxyEnabled(_ isEnabled: Bool) async {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import Libbox
|
||||
import Library
|
||||
import NetworkExtension
|
||||
import SwiftUI
|
||||
@@ -80,7 +81,16 @@ public struct StartStopButton: View {
|
||||
try await profile.start()
|
||||
await environments.logClient.connect()
|
||||
} else {
|
||||
var err: Error?
|
||||
do {
|
||||
try LibboxNewStandaloneCommandClient()!.serviceClose()
|
||||
} catch {
|
||||
err = error
|
||||
}
|
||||
await profile.stop()
|
||||
if let err {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
await MainActor.run {
|
||||
|
||||
Reference in New Issue
Block a user