From 848b8968fc239efbf7df8e1e644a985636ad81e2 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Thu, 10 Sep 2020 23:35:52 -0700 Subject: [PATCH] Restore just launched checker. --- Secretive/App.swift | 4 ++++ Secretive/Controllers/LaunchAgentController.swift | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) 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 {