auto active service when create first server profile

This commit is contained in:
Yicheng
2016-08-22 23:26:04 +08:00
parent 4f982d48e0
commit 671816b592
2 changed files with 9 additions and 1 deletions

View File

@ -78,6 +78,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
notifyCenter.addObserverForName(NOTIFY_SERVER_PROFILES_CHANGED, object: nil, queue: nil
, usingBlock: {
(note) in
let profileMgr = ServerProfileManager.instance
if profileMgr.activeProfileId == nil &&
profileMgr.profiles.count > 0{
if profileMgr.profiles[0].isValid(){
profileMgr.setActiveProfiledId(profileMgr.profiles[0].uuid)
}
}
self.updateServersMenu()
SyncSSLocal()
}