Commit e6cf38e6 authored by Mygod's avatar Mygod

Bugfix

parent cdb9ebe5
......@@ -457,7 +457,6 @@ class Shadowsocks
case None => // removed
val profiles = ShadowsocksApplication.profileManager.getAllProfiles.getOrElse(List[Profile]())
ShadowsocksApplication.profileId(if (profiles.isEmpty) -1 else profiles.head.id)
ShadowsocksApplication.currentProfile getOrElse currentProfile
}
updatePreferenceScreen()
......
......@@ -77,7 +77,10 @@ object ShadowsocksApplication {
.build())
def profileId = settings.getInt(Key.profileId, -1)
def profileId(i: Int) = settings.edit.putInt(Key.profileId, i).apply
def profileId(i: Int) = {
settings.edit.putInt(Key.profileId, i).apply
profileManager.load(i)
}
def proxy = settings.getString(Key.proxy, "")
def currentProfile = profileManager.getProfile(profileId)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment