Refactor task usage and profile auto update

This commit is contained in:
世界
2023-09-22 11:32:51 +08:00
parent 390e063f20
commit 3374f8e727
49 changed files with 823 additions and 636 deletions
+3 -3
View File
@@ -12,12 +12,12 @@ public class ExtensionEnvironments: ObservableObject {
}
public func postReload() {
Task.detached {
await self.reload()
Task {
await reload()
}
}
public func reload() async {
public nonisolated func reload() async {
if let newProfile = try? await ExtensionProfile.load() {
if extensionProfile == nil || extensionProfile?.status == .invalid {
newProfile.register()