From c5214d886e3ce04c8d06f2dba332142e922c35ec Mon Sep 17 00:00:00 2001 From: Ray <154766448+damontecres@users.noreply.github.com> Date: Thu, 18 Dec 2025 16:20:24 -0500 Subject: [PATCH] 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 --- .../wholphin/ui/components/CollectionFolderGrid.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/components/CollectionFolderGrid.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/components/CollectionFolderGrid.kt index f22e87a2..7ff7fdcf 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/components/CollectionFolderGrid.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/components/CollectionFolderGrid.kt @@ -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,