Refine updateCurrentProfile

This commit is contained in:
Mygod
2016-06-17 13:01:09 +08:00
parent c0975a3e6f
commit d350088153
2 changed files with 3 additions and 4 deletions
@@ -491,10 +491,10 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
currentProfile = app.currentProfile match {
case Some(profile) => profile // updated
case None => // removed
app.profileManager.getFirstProfile match {
case Some(first) => app.switchProfile(first.id)
app.switchProfile((app.profileManager.getFirstProfile match {
case Some(first) => first
case None => app.profileManager.createDefault()
}
}).id)
}
updatePreferenceScreen()
@@ -208,6 +208,5 @@ class ProfileManager(settings: SharedPreferences, dbHelper: DBHelper) {
password = "u1rRWTssNv0p"
}
createProfile(profile)
profile
}
}