diff --git a/ShadowsocksX-NG/AppDelegate.swift b/ShadowsocksX-NG/AppDelegate.swift index a3de985..69300c1 100644 --- a/ShadowsocksX-NG/AppDelegate.swift +++ b/ShadowsocksX-NG/AppDelegate.swift @@ -207,7 +207,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele DispatchQueue.global().async { // Version Check! - if defaults.bool(forKey: "AutoCheckUpdate"){ + if defaults.bool(forKey: "AutoCheckUpdate") { self.checkForUpdate(mustShowAlert: false) } if defaults.bool(forKey: "AutoUpdateSubscribe") { diff --git a/ShadowsocksX-NG/ServerProfileManager.swift b/ShadowsocksX-NG/ServerProfileManager.swift index cd19a7c..7dda904 100644 --- a/ShadowsocksX-NG/ServerProfileManager.swift +++ b/ShadowsocksX-NG/ServerProfileManager.swift @@ -26,6 +26,12 @@ class ServerProfileManager: NSObject { } } activeProfileId = defaults.string(forKey: "ActiveServerProfileId") + for p in profiles { + if p.uuid == activeProfileId { + return + } + } + activeProfileId = profiles[0].uuid } func setActiveProfiledId(_ id: String) {