Skip to content

Commit 4543fb2

Browse files
committed
Add toggle to prevent automatic launch agent installation
1 parent e9d3d2c commit 4543fb2

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

Core/Sources/HostApp/DebugView.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ final class DebugSettings: ObservableObject {
2929
var observeToAXNotificationWithDefaultMode
3030
@AppStorage(\.useCloudflareDomainNameForLicenseCheck)
3131
var useCloudflareDomainNameForLicenseCheck
32+
@AppStorage(\.doNotInstallLaunchAgentAutomatically)
33+
var doNotInstallLaunchAgentAutomatically
3234
init() {}
3335
}
3436

@@ -136,6 +138,12 @@ struct DebugSettingsView: View {
136138
Text("Use Cloudflare domain name for license check")
137139
}
138140

141+
Toggle(
142+
isOn: $settings.doNotInstallLaunchAgentAutomatically
143+
) {
144+
Text("Don't install launch agent automatically")
145+
}
146+
139147
Button("Reset update cycle") {
140148
updateChecker.resetUpdateCycle()
141149
}

Core/Sources/HostApp/General.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ struct General {
3232
switch action {
3333
case .appear:
3434
return .run { send in
35+
if UserDefaults.shared.value(for: \.doNotInstallLaunchAgentAutomatically) {
36+
return
37+
}
3538
await send(.setupLaunchAgentIfNeeded)
3639
}
3740

Tool/Sources/Preferences/Keys.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,5 +748,9 @@ public extension UserDefaultPreferenceKeys {
748748
var useCloudflareDomainNameForLicenseCheck: FeatureFlag {
749749
.init(defaultValue: false, key: "FeatureFlag-UseCloudflareDomainNameForLicenseCheck")
750750
}
751+
752+
var doNotInstallLaunchAgentAutomatically: FeatureFlag {
753+
.init(defaultValue: false, key: "FeatureFlag-DoNotInstallLaunchAgentAutomatically")
754+
}
751755
}
752756

0 commit comments

Comments
 (0)