From d944bc77f492a73a8447c59bb592dd19e37e01fe Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sun, 19 Feb 2023 19:46:55 -0800 Subject: [PATCH] fix admin token not correct issue --- LomoAgent/AppDelegate.swift | 1 - LomoAgent/StatusMenuController.swift | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/LomoAgent/AppDelegate.swift b/LomoAgent/AppDelegate.swift index d68ac02..52fb893 100644 --- a/LomoAgent/AppDelegate.swift +++ b/LomoAgent/AppDelegate.swift @@ -182,7 +182,6 @@ class AppDelegate: NSObject, NSApplicationDelegate { setupLogger() loadCrashLog() DDLogInfo("LomoAgent version: \(version)") - UserDefaults.standard.set(UUID().uuidString, forKey: PREF_ADMIN_TOKEN) // NotificationCenter.default.post(name: .NotifyStart, object: self) } } diff --git a/LomoAgent/StatusMenuController.swift b/LomoAgent/StatusMenuController.swift index 20f5d47..056e82b 100644 --- a/LomoAgent/StatusMenuController.swift +++ b/LomoAgent/StatusMenuController.swift @@ -288,6 +288,8 @@ class StatusMenuController: NSObject { let lomodPath = executablePath.path + "/lomod" DDLogInfo("lomod Path: \(lomodPath)") + UserDefaults.standard.set(UUID().uuidString, forKey: PREF_ADMIN_TOKEN) + if let homeDir = UserDefaults.standard.string(forKey: PREF_HOME_DIR), let baseDir = getBasePath(), let logDir = getLogDir(),