manager: fix module sorting state when module list is null initially before modules are fetched (this should fix #470)

This commit is contained in:
rifsxd
2025-06-01 19:47:43 +06:00
parent dddf2f06a0
commit d8cb7ef772

View File

@@ -125,9 +125,9 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE)
LaunchedEffect(Unit) {
viewModel.sortAToZ = prefs.getBoolean("module_sort_a_to_z", true)
viewModel.sortZToA = prefs.getBoolean("module_sort_z_to_a", false)
if (viewModel.moduleList.isEmpty() || viewModel.isNeedRefresh) {
viewModel.sortAToZ = prefs.getBoolean("module_sort_a_to_z", true)
viewModel.sortZToA = prefs.getBoolean("module_sort_z_to_a", false)
viewModel.fetchModuleList()
}
}