Refactor Alerts

This commit is contained in:
世界
2025-12-01 18:22:06 +08:00
parent 8e764c56eb
commit 4ddfcdb324
40 changed files with 324 additions and 224 deletions
@@ -8,7 +8,7 @@ public class GroupListViewModel: BaseViewModel {
private var pendingSelections: [String: String] = [:]
public override init() {
override public init() {
super.init()
isLoading = true
}
@@ -89,7 +89,7 @@ public class GroupListViewModel: BaseViewModel {
try await LibboxNewStandaloneCommandClient()!.selectOutbound(groupTag, outboundTag: outboundTag)
} catch {
await MainActor.run {
alert = Alert(error)
alert = AlertState(error: error)
}
}
}
@@ -108,7 +108,7 @@ public class GroupListViewModel: BaseViewModel {
try await LibboxNewStandaloneCommandClient()!.setGroupExpand(tag, isExpand: isExpand)
} catch {
await MainActor.run {
alert = Alert(error)
alert = AlertState(error: error)
}
}
}
@@ -124,7 +124,7 @@ public class GroupListViewModel: BaseViewModel {
try await LibboxNewStandaloneCommandClient()!.urlTest(tag)
} catch {
await MainActor.run {
alert = Alert(error)
alert = AlertState(error: error)
}
}
}