Refactor task usage and profile auto update
This commit is contained in:
@@ -6,7 +6,13 @@ import MacLibrary
|
||||
class IndependentApplicationDelegate: ApplicationDelegate {
|
||||
public func applicationWillFinishLaunching(_: Notification) {
|
||||
Variant.useSystemExtension = true
|
||||
Task.detached {
|
||||
Task {
|
||||
await setupSystemExtension()
|
||||
}
|
||||
}
|
||||
|
||||
private nonisolated func setupSystemExtension() async {
|
||||
do {
|
||||
if await SystemExtension.isInstalled() {
|
||||
if let result = try await SystemExtension.install() {
|
||||
if result == .willCompleteAfterReboot {
|
||||
@@ -14,6 +20,8 @@ class IndependentApplicationDelegate: ApplicationDelegate {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
NSLog("setup system extension error: \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user