Skip to content

Commit b449f2a

Browse files
fix(appList): use active filterType from uiState instead of stale _rawState
When updating app list filters, AppListViewModel previously read the current FilterType from _rawState.value. Since _rawState contains raw metadata (e.g. apps lists, loading/privilege flags) and does not update when preferences are modified, its filterType remained stuck at the default (FilterType.Source). As a result, when state filters (like 'Frozen') were selected, they were incorrectly persisted in DataStore as source filters, resulting in query mismatches and showing an empty list. Reading from uiState.value.filterType ensures the current user-selected filter type is retrieved and stored correctly.
1 parent 0e2e3d9 commit b449f2a

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

app/src/main/java/com/valhalla/thor/presentation/appList/AppListViewModel.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ class AppListViewModel(
284284
fun updateFilter(filter: String) {
285285
viewModelScope.launch {
286286
// We need to know current filter type to update properly
287-
// We read from _rawState because uiState might be updating asynchronously
288-
val currentType = _rawState.value.filterType
287+
val currentType = uiState.value.filterType
289288
preferenceRepository.updateAppFilter(currentType, filter)
290289
}
291290
}

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ org.gradle.welcome=never
4646
# APPLICATION VERSIONING (REPRODUCIBLE BUILD SETUP)
4747
# -----------------------------------------------------------------------------
4848
# Kept as fallback for clean builds
49-
initialVersionCode=1814
49+
initialVersionCode=1815
5050
# REQUIRED: The active source of truth for your release manager
51-
# Logic: 1813 -> 1.81.3 (based on math: code/1000 . code%1000/10 . code%10)
52-
versionCode=1814
53-
versionName=1.81.4
51+
# Logic: 1815 -> 1.81.5 (based on math: code/1000 . code%1000/10 . code%10)
52+
versionCode=1815
53+
versionName=1.81.5

0 commit comments

Comments
 (0)