Commit 1362e8ce authored by Max Lv's avatar Max Lv

Keep user configured profiles after sync

parent 3a281beb
...@@ -70,6 +70,7 @@ object ProfileManager { ...@@ -70,6 +70,7 @@ object ProfileManager {
it.tx = tx it.tx = tx
it.rx = rx it.rx = rx
} }
it.subscription = Profile.SubscriptionStatus.Active
createProfile(it) createProfile(it)
} }
} }
......
...@@ -41,6 +41,7 @@ import com.github.shadowsocks.MainActivity ...@@ -41,6 +41,7 @@ import com.github.shadowsocks.MainActivity
import com.github.shadowsocks.R import com.github.shadowsocks.R
import com.github.shadowsocks.ToolbarFragment import com.github.shadowsocks.ToolbarFragment
import com.github.shadowsocks.bg.BaseService import com.github.shadowsocks.bg.BaseService
import com.github.shadowsocks.database.Profile
import com.github.shadowsocks.database.ProfileManager import com.github.shadowsocks.database.ProfileManager
import com.github.shadowsocks.plugin.AlertDialogFragment import com.github.shadowsocks.plugin.AlertDialogFragment
import com.github.shadowsocks.utils.asIterable import com.github.shadowsocks.utils.asIterable
...@@ -245,6 +246,14 @@ class SubscriptionFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener ...@@ -245,6 +246,14 @@ class SubscriptionFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener
} }
} }
val userProfiles = oldProfiles?.filter { it.subscription == Profile.SubscriptionStatus.UserConfigured }
if (userProfiles != null) {
for (profile in userProfiles.asIterable()) {
ProfileManager.createProfile(profile)
}
}
progress.post { progress.post {
progress.visibility = View.INVISIBLE progress.visibility = View.INVISIBLE
} }
......
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