From b6aec3fd63feb176f46bd31628d3a3857dcb7dfb Mon Sep 17 00:00:00 2001 From: zhaoguomanong Date: Thu, 11 Aug 2022 13:20:34 +0800 Subject: [PATCH 1/2] fix translation error Signed-off-by: zhaoguomanong --- V2rayNG/app/src/main/res/values-zh-rTW/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml b/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml index 927e1f05..4b7234b5 100644 --- a/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml @@ -31,7 +31,7 @@ 手動鍵入 [Trojan] 自訂組態 從剪貼簿匯入自訂組態 - 從 URL 匯入自訂組態 + 從本地匯入自訂組態 從 URL 匯入自訂組態 掃描 URL 匯入自訂組態 確定刪除? From 8b76a7a4f4ab604c4d06bf7a53f0bc9e365d258b Mon Sep 17 00:00:00 2001 From: zhaoguomanong Date: Fri, 12 Aug 2022 11:04:23 +0800 Subject: [PATCH 2/2] avoid modifying serversCache serverList from multithreading Bug: app force close during updating subscribe Reroduce steps: quickly scroll up and down the RecyclerView during updating subscribe if the server list length is more than the screen height, the bug can be 100% reproduced Solution: reloadServerList from UI Thread Signed-off-by: zhaoguomanong --- .../main/kotlin/com/v2ray/ang/viewmodel/MainViewModel.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/MainViewModel.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/MainViewModel.kt index 7b56bdf4..6eb26e14 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/MainViewModel.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/viewmodel/MainViewModel.kt @@ -54,12 +54,8 @@ class MainViewModel(application: Application) : AndroidViewModel(application) { fun reloadServerList() { serverList = MmkvManager.decodeServerList() - viewModelScope.launch(Dispatchers.Default) { - updateCache() - launch(Dispatchers.Main) { - updateListAction.value = -1 - } - } + updateCache() + updateListAction.value = -1 } fun removeServer(guid: String) {