Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Unspoiler all images when switching to download mode in album.
Browse files Browse the repository at this point in the history
  • Loading branch information
K1rakishou committed Sep 28, 2024
1 parent 94edca3 commit 6a98647
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ fun AlbumItem(
onDispose { onDemandContentLoaderManager.onPostUnbind(albumItemData.postDescriptor, true) }
}

val requestProvider = remember(key1 = albumItemData, key2 = albumSpanCount, key3 = chanDescriptorUi) {
val requestProvider = remember(chanDescriptorUi, albumItemData, albumSpanCount, isInSelectionMode) {
getImageLoaderRequestProvider(
chanDescriptor = chanDescriptorUi?.chanDescriptor,
albumItemData = albumItemData,
albumSpanCount = albumSpanCount
albumSpanCount = albumSpanCount,
isInSelectionMode = isInSelectionMode
)
}

Expand Down Expand Up @@ -295,14 +296,15 @@ private fun Modifier.albumItemSelection(
private fun getImageLoaderRequestProvider(
chanDescriptor: ChanDescriptor?,
albumItemData: AlbumItemData,
albumSpanCount: Int
albumSpanCount: Int,
isInSelectionMode: Boolean
): ImageLoaderRequestProvider {
val cacheHandler = appDependencies().cacheHandler
val chanThreadsCache = appDependencies().chanThreadsCache
val revealedSpoilerImagesManager = appDependencies().revealedSpoilerImagesManager

return ImageLoaderRequestProvider(
key = ImageLoaderRequestProvider.FullKey(arrayOf(chanDescriptor, albumItemData, albumItemData)),
key = ImageLoaderRequestProvider.FullKey(arrayOf(chanDescriptor, albumItemData, albumItemData, isInSelectionMode)),
provide = {
if (chanDescriptor == null) {
return@ImageLoaderRequestProvider null
Expand Down Expand Up @@ -332,7 +334,7 @@ private fun getImageLoaderRequestProvider(
cacheHandler = cacheHandler,
postImage = postImage,
canUseHighResCells = canUseHighResCells,
revealSpoilerImage = revealSpoilerImage
revealSpoilerImage = revealSpoilerImage || isInSelectionMode
)

if (imageUrl == null || cacheFileType == null) {
Expand Down

0 comments on commit 6a98647

Please sign in to comment.