Tiny fix
This commit is contained in:
1 parent
1b13fadce7
commit
f7f170e8d3
2 files changed
+2
-10
No files matched your search
@@ -177,15 +177,7 @@ class MainRepository(
|
||||
MmkvManager.clearAllTestDelayResults(guids)
|
||||
|
||||
override fun sortByTestResultsForSub(subId: String) {
|
||||
val sorted = MmkvManager.decodeServerList(subId)
|
||||
.map { guid ->
|
||||
val delay =
|
||||
MmkvManager.decodeServerAffiliationInfo(guid)?.testDelayMillis ?: 0L
|
||||
guid to if (delay <= 0L) Long.MAX_VALUE else delay
|
||||
}
|
||||
.sortedBy { it.second }
|
||||
.mapTo(ArrayList()) { it.first }
|
||||
MmkvManager.encodeServerList(sorted, subId)
|
||||
AngConfigManager.sortByTestResultsForSub(subId)
|
||||
}
|
||||
|
||||
override fun getSubsList(): List<String> = MmkvManager.decodeSubsList()
|
||||
|
||||
@@ -95,7 +95,7 @@ class MainViewModel(
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun handleServiceEvent(event: MainServiceEvent) {
|
||||
private fun handleServiceEvent(event: MainServiceEvent) {
|
||||
when (event) {
|
||||
MainServiceEvent.StateRunning -> updateRunningState(true, clearTestingText = false)
|
||||
MainServiceEvent.StateNotRunning -> updateRunningState(false, clearTestingText = false)
|
||||
|
||||
Reference in new issue
Block a user