Skip to content

Commit 295d65a

Browse files
committed
refactor: simplify launch at login registration logic
1 parent 034b67b commit 295d65a

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Micmute/Utilities/LaunchAtLoginManager.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ import ServiceManagement
1010

1111
struct LaunchAtLoginManager {
1212
static func update(_ enable: Bool) {
13-
if #available(macOS 14.0, *) {
14-
do {
15-
if enable {
16-
try SMAppService.mainApp.register()
17-
} else {
18-
try SMAppService.mainApp.unregister()
19-
}
20-
} catch {
21-
print("Error updating launch at login: \(error)")
13+
do {
14+
if enable {
15+
try SMAppService.mainApp.register()
16+
} else {
17+
try SMAppService.mainApp.unregister()
2218
}
19+
} catch {
20+
print("Error updating launch at login: \(error)")
2321
}
2422
}
2523
}

0 commit comments

Comments
 (0)