mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-07-03 23:46:45 +08:00
fix: Selected patch count (#2559)
This commit is contained in:
@ -131,7 +131,7 @@ class SelectedAppInfoViewModel(
|
|||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
if (!persistConfiguration) return@launch // TODO: save options for patched apps.
|
if (!persistConfiguration) return@launch // TODO: save options for patched apps.
|
||||||
|
|
||||||
state.value = withContext(Dispatchers.Default) {
|
options = withContext(Dispatchers.Default) {
|
||||||
val bundlePatches = bundleRepository.bundles.first()
|
val bundlePatches = bundleRepository.bundles.first()
|
||||||
.mapValues { (_, bundle) -> bundle.patches.associateBy { it.name } }
|
.mapValues { (_, bundle) -> bundle.patches.associateBy { it.name } }
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ class SelectedAppInfoViewModel(
|
|||||||
}
|
}
|
||||||
private set
|
private set
|
||||||
|
|
||||||
private var selectionState by savedStateHandle.saveable {
|
private var selectionState: SelectionState by savedStateHandle.saveable {
|
||||||
if (input.patches != null)
|
if (input.patches != null)
|
||||||
return@saveable mutableStateOf(SelectionState.Customized(input.patches))
|
return@saveable mutableStateOf(SelectionState.Customized(input.patches))
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ class SelectedAppInfoViewModel(
|
|||||||
|
|
||||||
val previous = selectionRepository.getSelection(packageName)
|
val previous = selectionRepository.getSelection(packageName)
|
||||||
if (previous.values.sumOf { it.size } == 0) return@launch
|
if (previous.values.sumOf { it.size } == 0) return@launch
|
||||||
selection.value = SelectionState.Customized(previous)
|
selectionState = SelectionState.Customized(previous)
|
||||||
}
|
}
|
||||||
|
|
||||||
selection
|
selection
|
||||||
|
Reference in New Issue
Block a user