From bd554a8cd4a286935957fcfe71a90a63c51054a5 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Tue, 13 Jun 2023 18:43:03 +0200 Subject: [PATCH] only register as login item in Release builds --- WakaTime/WakaTime.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/WakaTime/WakaTime.swift b/WakaTime/WakaTime.swift index 35eec25..b6ae552 100644 --- a/WakaTime/WakaTime.swift +++ b/WakaTime/WakaTime.swift @@ -38,6 +38,7 @@ class WakaTime { } private func registerAsLoginItem() { + guard shouldRegisterAsLoginItem() else { return } guard !SettingsManager.loginItemRegistered(), PropertiesManager.shouldLaunchOnLogin @@ -45,6 +46,14 @@ class WakaTime { 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]