mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
refactor(apple): Downgrade error for repeated sysex enabling (#7816)
If the user again clicks `Enable System Extension` without having actually enabled it in system settings, this error will be reported. We don't necessarily need to act on it.
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
import SwiftUI
|
||||
import Combine
|
||||
|
||||
#if os(macOS)
|
||||
import SystemExtensions
|
||||
#endif
|
||||
|
||||
@MainActor
|
||||
final class GrantVPNViewModel: ObservableObject {
|
||||
@Published var isInstalled: Bool = false
|
||||
@@ -33,13 +37,19 @@ final class GrantVPNViewModel: ObservableObject {
|
||||
do {
|
||||
try await store.installSystemExtension()
|
||||
|
||||
|
||||
// The window has a tendency to go to the background after installing
|
||||
// the system extension
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
|
||||
} catch {
|
||||
Log.error(error)
|
||||
if let error = error as? OSSystemExtensionError,
|
||||
case OSSystemExtensionError.requestSuperseded = error { // Code 12
|
||||
// This will happen if the user repeatedly clicks the `Enable` button
|
||||
// before actually enabling it in system settings.
|
||||
Log.info("\(#function): Request superseded: \(error)")
|
||||
} else {
|
||||
Log.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user