Use decoded server list when removing servers

This commit is contained in:
2dust committed 2026-06-13 15:32:15 +08:00
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
}