Commit 447ebd51 authored by Mygod's avatar Mygod

Fix traffic stat not imported

parent 1a9fd998
......@@ -265,12 +265,12 @@ class MainPreferenceFragment : LeanbackPreferenceFragment(), ShadowsocksConnecti
for (uri in data!!.datas) try {
Profile.parseJson(activity.contentResolver.openInputStream(uri)!!.bufferedReader().readText(),
feature).forEach {
ProfileManager.createProfile(it)
// if two profiles has the same address, treat them as the same profile and copy stats over
profiles?.get(it.formattedAddress)?.apply {
it.tx = tx
it.rx = rx
}
ProfileManager.createProfile(it)
}
} catch (e: Exception) {
printLog(e)
......
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