Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(HomeLastPicCollectionViewCell): Refresh during multi selection deselects all #1371

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adrien-coye
Copy link
Contributor

Explicit the selected state of the cell during its configuration

@adrien-coye adrien-coye added the bug Something isn't working label Jan 2, 2025
Copy link

sonarqubecloud bot commented Jan 2, 2025

@@ -94,7 +99,8 @@ class HomeLastPicCollectionViewCell: UICollectionViewCell {
contentInsetView.cornerRadius = UIConstants.cornerRadius
}
videoData.isHidden = !(file.uti.conforms(to: .video) || file.uti.conforms(to: .movie))
configureForSelection()

self.isSelected = isSelected
Copy link
Contributor Author

@adrien-coye adrien-coye Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting it will call configureForSelection on didSet

@@ -31,6 +31,10 @@ class HomeLastPicCollectionViewCell: UICollectionViewCell {
private var thumbnailDownloadTask: Kingfisher.DownloadTask?

override var isSelected: Bool {
willSet {
// NOTE: DifferenceKit reset the selected flag mid air. Investigating
print("•• isSelected changed: \(newValue) fid:\(file?.id)")
Copy link
Contributor Author

@adrien-coye adrien-coye Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diffKit will set to false after the configuration of the cell, disabling it.
I'm still looking for an elegant fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant