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.
This commit is contained in:
austinried
2026-10-04 00:30:05 +00:00
parent d3aaeca405
commit 95ac4ae6ce
@@ -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()