mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user