Commit c208c4bf authored by Max Lv's avatar Max Lv

refine profile initilizing

parent 34af6aee
......@@ -474,22 +474,22 @@ class Shadowsocks
addPreferencesFromResource(R.xml.pref_all)
// Initialize the profile
currentProfile = {
profileManager.getProfile(settings.getInt(Key.profileId, -1)) getOrElse currentProfile
}
// Update the profile
if (!status.getBoolean(getVersionName, false)) {
val h = showProgress(getString(R.string.initializing))
status.edit.putBoolean(getVersionName, true).apply()
currentProfile = profileManager.create()
spawn {
reset()
currentProfile = profileManager.create()
h.sendEmptyMessage(0)
}
}
// Initialize the profile
currentProfile = {
profileManager.getProfile(settings.getInt(Key.profileId, -1)) getOrElse currentProfile
}
// Initialize drawer
menuAdapter.setActiveId(settings.getInt(Key.profileId, -1))
menuAdapter.setListener(this)
......
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