refactor: update key generation in ContinueWatchingSection and GridContinueWatchingSection for better uniqueness

This commit is contained in:
tapframe 2026-02-17 16:30:48 +05:30
parent 582afcd7b3
commit 197b2f1901
2 changed files with 6 additions and 6 deletions

View file

@ -121,10 +121,10 @@ fun ContinueWatchingSection(
) {
itemsIndexed(
items = items,
key = { _, progress ->
key = { index, progress ->
when (progress) {
is ContinueWatchingItem.InProgress -> progress.progress.videoId
is ContinueWatchingItem.NextUp -> "nextup_${progress.info.videoId}"
is ContinueWatchingItem.InProgress -> "cw_${progress.progress.videoId}_$index"
is ContinueWatchingItem.NextUp -> "nextup_${progress.info.videoId}_$index"
}
}
) { index, progress ->

View file

@ -78,10 +78,10 @@ fun GridContinueWatchingSection(
) {
itemsIndexed(
items = items,
key = { _, item ->
key = { index, item ->
when (item) {
is ContinueWatchingItem.InProgress -> "cw_${item.progress.videoId}"
is ContinueWatchingItem.NextUp -> "nextup_${item.info.videoId}"
is ContinueWatchingItem.InProgress -> "cw_${item.progress.videoId}_$index"
is ContinueWatchingItem.NextUp -> "nextup_${item.info.videoId}_$index"
}
}
) { index, progress ->