Fix backdrop not clearing on favorite tab changes (#507)

## Description
Fixes the backdrop not being cleared when switching tabs on the
favorites page by ensuring each has a unique view model.

Also clears the backdrop if the view option to show details is turned
off.

### Related issues
#476 
#499
This commit is contained in:
Ray 2025-12-18 16:20:24 -05:00 committed by GitHub
parent fd260f2709
commit c5214d886e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -205,6 +205,9 @@ class CollectionFolderViewModel
this.viewOptions.value = viewOptions
viewModelScope.launch(ExceptionHandler() + Dispatchers.IO) {
saveLibraryDisplayInfo(viewOptions = viewOptions)
if (!viewOptions.showDetails) {
backdropService.clearBackdrop()
}
}
}
@ -514,7 +517,7 @@ fun CollectionFolderGrid(
playEnabled: Boolean,
defaultViewOptions: ViewOptions,
modifier: Modifier = Modifier,
viewModel: CollectionFolderViewModel = hiltViewModel(),
viewModel: CollectionFolderViewModel = hiltViewModel(key = itemId),
playlistViewModel: AddPlaylistViewModel = hiltViewModel(),
initialSortAndDirection: SortAndDirection? = null,
showTitle: Boolean = true,