refactor: Fix macOS standalone application

This commit is contained in:
世界
2026-01-05 01:21:24 +08:00
parent ef1c924c64
commit 59317f3c79
66 changed files with 2799 additions and 585 deletions
@@ -1,4 +1,3 @@
import Libbox
import Library
import SwiftUI
@@ -15,7 +14,7 @@ public struct ProfileOverrideView: View {
Group {
if isLoading {
ProgressView().onAppear {
Task.detached {
Task {
await loadSettings()
}
}
@@ -64,12 +63,13 @@ public struct ProfileOverrideView: View {
return
}
do {
try LibboxNewStandaloneCommandClient()?.serviceReload()
try await profile.reloadService()
} catch {
alert = AlertState(error: error)
}
}
@MainActor
private func loadSettings() async {
excludeDefaultRoute = await SharedPreferences.excludeDefaultRoute.get()
autoRouteUseSubRangesByDefault = await SharedPreferences.autoRouteUseSubRangesByDefault.get()