Fix dashboard refresh
This commit is contained in:
@@ -117,11 +117,7 @@ public class CommandClient: ObservableObject {
|
||||
clientOptions.addCommand(LibboxCommandConnections)
|
||||
}
|
||||
}
|
||||
if connectionTypes.contains(.log) {
|
||||
clientOptions.statusInterval = Int64(500 * NSEC_PER_MSEC)
|
||||
} else {
|
||||
clientOptions.statusInterval = Int64(NSEC_PER_SEC)
|
||||
}
|
||||
clientOptions.statusInterval = Int64(NSEC_PER_SEC)
|
||||
let client = LibboxNewCommandClient(clientHandler(self), clientOptions)!
|
||||
do {
|
||||
for i in 0 ..< 10 {
|
||||
|
||||
@@ -2,7 +2,7 @@ import Foundation
|
||||
import SwiftUI
|
||||
|
||||
public class ExtensionEnvironments: ObservableObject {
|
||||
@Published public var logClient = CommandClient(.log)
|
||||
@Published public var commandClient = CommandClient([.log, .status, .groups, .clashMode, .connections])
|
||||
@Published public var extensionProfileLoading = true
|
||||
@Published public var extensionProfile: ExtensionProfile?
|
||||
@Published public var emptyProfiles = false
|
||||
@@ -14,7 +14,7 @@ public class ExtensionEnvironments: ObservableObject {
|
||||
public init() {}
|
||||
|
||||
deinit {
|
||||
logClient.disconnect()
|
||||
commandClient.disconnect()
|
||||
}
|
||||
|
||||
public func postReload() {
|
||||
@@ -37,12 +37,12 @@ public class ExtensionEnvironments: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
public func connectLog() {
|
||||
public func connect() {
|
||||
guard let profile = extensionProfile else {
|
||||
return
|
||||
}
|
||||
if profile.status.isConnected, !logClient.isConnected {
|
||||
logClient.connect()
|
||||
if profile.status.isConnected, !commandClient.isConnected {
|
||||
commandClient.connect()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ open class ExtensionProvider: NEPacketTunnelProvider {
|
||||
private var platformInterface: ExtensionPlatformInterface!
|
||||
|
||||
override open func startTunnel(options _: [String: NSObject]?) async throws {
|
||||
LibboxClearServiceError()
|
||||
|
||||
let options = LibboxSetupOptions()
|
||||
options.basePath = FilePath.sharedDirectory.relativePath
|
||||
options.workingPath = FilePath.workingDirectory.relativePath
|
||||
|
||||
Reference in New Issue
Block a user