From 95ac4ae6ce78e789ef8133bada8b56084d12c11a Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Wed, 30 Sep 2026 13:32:18 +0000 Subject: [PATCH] drop the sort auto-reset It compared a possibly stale listQuery (the previous tab's value during a tab switch) against the new tab's options and rewrote the new tab's query to its default, so sorts appeared to reset. Not worth the fragility for a hidden-option edge case. --- .../main/kotlin/com/subtracks/ui/library/LibraryScreen.kt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/src/main/kotlin/com/subtracks/ui/library/LibraryScreen.kt b/app/src/main/kotlin/com/subtracks/ui/library/LibraryScreen.kt index e28d21d2..5664c9be 100644 --- a/app/src/main/kotlin/com/subtracks/ui/library/LibraryScreen.kt +++ b/app/src/main/kotlin/com/subtracks/ui/library/LibraryScreen.kt @@ -223,11 +223,6 @@ fun LibraryRoute( val playSort by viewModel.playSortAvailability.collectAsStateWithLifecycle() val displayQuery = if (offline) listQuery.copy(downloaded = true) else listQuery val search by viewModel.search(listTab).collectAsStateWithLifecycle() - LaunchedEffect(listTab, playSort, listQuery.sort) { - if (sortOptionsFor(selectedTab, playSort).none { it.value == listQuery.sort }) { - viewModel.setListQuery(listTab, listQuery.copy(sort = listTab.defaultSort)) - } - } val resetKeys = LibraryTab.entries.associateWith { tab -> val query by viewModel.listQuery(tab.listTab()).collectAsStateWithLifecycle()