Skip to content

Commit

Permalink
only register as login item in Release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Jun 13, 2023
1 parent 9facfa5 commit bd554a8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions WakaTime/WakaTime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,22 @@ class WakaTime {
}

private func registerAsLoginItem() {
guard shouldRegisterAsLoginItem() else { return }
guard
!SettingsManager.loginItemRegistered(),
PropertiesManager.shouldLaunchOnLogin
else { return }
SettingsManager.registerAsLoginItem()
}

private func shouldRegisterAsLoginItem() -> Bool {
#if DEBUG
return false
#else
return true
#endif
}

private func requestA11yPermission() {
let prompt = kAXTrustedCheckOptionPrompt.takeUnretainedValue() as String
let options: NSDictionary = [prompt: true]
Expand Down

0 comments on commit bd554a8

Please sign in to comment.