Fix dashboard refresh

This commit is contained in:
世界
2025-11-26 22:25:48 +08:00
parent 437fe7ac31
commit f5a02d9da0
15 changed files with 32 additions and 65 deletions
@@ -32,13 +32,8 @@ class DashboardViewModel: ObservableObject {
func handleStatusChange(_ status: NEVPNStatus, profile: ExtensionProfile) {
if status == .connected {
notStarted = false
}
if status == .disconnecting || status == .connected {
Task {
await checkServiceError()
if status == .connected {
await checkDeprecatedNotes()
}
await checkDeprecatedNotes()
}
} else if status == .connecting {
notStarted = true
@@ -107,17 +102,6 @@ class DashboardViewModel: ObservableObject {
}
}
nonisolated func checkServiceError() async {
var error: NSError?
let message = LibboxReadServiceError(&error)
if error != nil {
return
}
await MainActor.run {
alert = Alert(title: Text("Service Error"), message: Text(message!.value))
}
}
@available(iOS 16.0, macOS 13.0, tvOS 17.0, *)
nonisolated func checkLastDisconnectError(profile: ExtensionProfile) async {
var myError: NSError