diff --git a/Secretive/App.swift b/Secretive/App.swift index 2e2d95a..6b7f686 100644 --- a/Secretive/App.swift +++ b/Secretive/App.swift @@ -35,6 +35,10 @@ struct AppDelegate: App { if !hasRunSetup { showingSetup = true } + if agentStatusChecker.running && justUpdatedChecker.justUpdated { + _ = LaunchAgentController().install() + } + } } .commands { diff --git a/Secretive/Controllers/LaunchAgentController.swift b/Secretive/Controllers/LaunchAgentController.swift index 8077da5..10b9150 100644 --- a/Secretive/Controllers/LaunchAgentController.swift +++ b/Secretive/Controllers/LaunchAgentController.swift @@ -4,12 +4,8 @@ import ServiceManagement struct LaunchAgentController { func install() -> Bool { - setEnabled(true) - } - - func relaunch() { _ = setEnabled(false) - _ = setEnabled(true) + return setEnabled(true) } private func setEnabled(_ enabled: Bool) -> Bool {