Use decoded server list when removing servers
This commit is contained in:
1 parent
71f94db929
commit
dcd060e350
1 file changed
+4
-4
@@ -341,11 +341,11 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
|
||||
if (subscriptionId.isEmpty() && keywordFilter.isEmpty()) {
|
||||
MmkvManager.removeAllServer()
|
||||
} else {
|
||||
val serversCopy = serversCache.toList()
|
||||
for (item in serversCopy) {
|
||||
MmkvManager.removeServer(item.guid)
|
||||
val serverList = MmkvManager.decodeServerList(subscriptionId)
|
||||
for (guid in serverList) {
|
||||
MmkvManager.removeServer(guid)
|
||||
}
|
||||
serversCache.toList().count()
|
||||
serverList.count()
|
||||
}
|
||||
return count
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user