mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Fix movie page library & collection tabs not updating (#594)
## Description Ensures the tabs on movie page use separate view models so the data isn't shared between them. ### Related issues Fixes #591
This commit is contained in:
parent
aa194f5a2d
commit
622a99631b
2 changed files with 6 additions and 1 deletions
|
|
@ -518,6 +518,7 @@ fun CollectionFolderGrid(
|
||||||
playEnabled: Boolean,
|
playEnabled: Boolean,
|
||||||
defaultViewOptions: ViewOptions,
|
defaultViewOptions: ViewOptions,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
viewModelKey: String? = itemId.toServerString(),
|
||||||
initialSortAndDirection: SortAndDirection? = null,
|
initialSortAndDirection: SortAndDirection? = null,
|
||||||
showTitle: Boolean = true,
|
showTitle: Boolean = true,
|
||||||
positionCallback: ((columns: Int, position: Int) -> Unit)? = null,
|
positionCallback: ((columns: Int, position: Int) -> Unit)? = null,
|
||||||
|
|
@ -531,6 +532,7 @@ fun CollectionFolderGrid(
|
||||||
onClickItem,
|
onClickItem,
|
||||||
sortOptions,
|
sortOptions,
|
||||||
playEnabled,
|
playEnabled,
|
||||||
|
viewModelKey = viewModelKey,
|
||||||
defaultViewOptions = defaultViewOptions,
|
defaultViewOptions = defaultViewOptions,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
initialSortAndDirection = initialSortAndDirection,
|
initialSortAndDirection = initialSortAndDirection,
|
||||||
|
|
@ -551,6 +553,7 @@ fun CollectionFolderGrid(
|
||||||
playEnabled: Boolean,
|
playEnabled: Boolean,
|
||||||
defaultViewOptions: ViewOptions,
|
defaultViewOptions: ViewOptions,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
viewModelKey: String? = itemId,
|
||||||
initialSortAndDirection: SortAndDirection? = null,
|
initialSortAndDirection: SortAndDirection? = null,
|
||||||
showTitle: Boolean = true,
|
showTitle: Boolean = true,
|
||||||
positionCallback: ((columns: Int, position: Int) -> Unit)? = null,
|
positionCallback: ((columns: Int, position: Int) -> Unit)? = null,
|
||||||
|
|
@ -559,7 +562,7 @@ fun CollectionFolderGrid(
|
||||||
playlistViewModel: AddPlaylistViewModel = hiltViewModel(),
|
playlistViewModel: AddPlaylistViewModel = hiltViewModel(),
|
||||||
viewModel: CollectionFolderViewModel =
|
viewModel: CollectionFolderViewModel =
|
||||||
hiltViewModel<CollectionFolderViewModel, CollectionFolderViewModel.Factory>(
|
hiltViewModel<CollectionFolderViewModel, CollectionFolderViewModel.Factory>(
|
||||||
key = itemId,
|
key = viewModelKey,
|
||||||
) {
|
) {
|
||||||
it.create(
|
it.create(
|
||||||
itemId = itemId,
|
itemId = itemId,
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,7 @@ fun CollectionFolderMovie(
|
||||||
preferencesViewModel.navigationManager.navigateTo(item.destination())
|
preferencesViewModel.navigationManager.navigateTo(item.destination())
|
||||||
},
|
},
|
||||||
itemId = destination.itemId,
|
itemId = destination.itemId,
|
||||||
|
viewModelKey = "${destination.itemId}_library",
|
||||||
initialFilter =
|
initialFilter =
|
||||||
CollectionFolderFilter(
|
CollectionFolderFilter(
|
||||||
filter =
|
filter =
|
||||||
|
|
@ -146,6 +147,7 @@ fun CollectionFolderMovie(
|
||||||
preferencesViewModel.navigationManager.navigateTo(item.destination())
|
preferencesViewModel.navigationManager.navigateTo(item.destination())
|
||||||
},
|
},
|
||||||
itemId = destination.itemId,
|
itemId = destination.itemId,
|
||||||
|
viewModelKey = "${destination.itemId}_collection",
|
||||||
initialFilter =
|
initialFilter =
|
||||||
CollectionFolderFilter(
|
CollectionFolderFilter(
|
||||||
filter =
|
filter =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue