Commit d3500881 authored by Mygod's avatar Mygod

Refine updateCurrentProfile

parent c0975a3e
...@@ -491,10 +491,10 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext { ...@@ -491,10 +491,10 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
currentProfile = app.currentProfile match { currentProfile = app.currentProfile match {
case Some(profile) => profile // updated case Some(profile) => profile // updated
case None => // removed case None => // removed
app.profileManager.getFirstProfile match { app.switchProfile((app.profileManager.getFirstProfile match {
case Some(first) => app.switchProfile(first.id) case Some(first) => first
case None => app.profileManager.createDefault() case None => app.profileManager.createDefault()
} }).id)
} }
updatePreferenceScreen() updatePreferenceScreen()
......
...@@ -208,6 +208,5 @@ class ProfileManager(settings: SharedPreferences, dbHelper: DBHelper) { ...@@ -208,6 +208,5 @@ class ProfileManager(settings: SharedPreferences, dbHelper: DBHelper) {
password = "u1rRWTssNv0p" password = "u1rRWTssNv0p"
} }
createProfile(profile) createProfile(profile)
profile
} }
} }
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