Don't add to selection unless in batch select mode

Fixes:

- choose attachment > media library
- tap image A
- tap back
- tap select
- select images B, C
- tap Done
- see image A, B, and C in the rail, but should just see image B and C
pull/1/head
Michael Kirk 6 years ago
parent 2df6ae2cfd
commit 5fdb88ddf4

@ -513,17 +513,11 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat
}
override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if !isInBatchSelectMode {
// Clear previous selection, if any.
selectedIds.removeAllObjects()
}
let asset = photoCollectionContents.asset(at: indexPath.item)
let assetId = asset.localIdentifier
selectedIds.add(assetId)
if isInBatchSelectMode {
let assetId = asset.localIdentifier
selectedIds.add(assetId)
updateDoneButton()
} else {
// Don't show "selected" badge unless we're in batch mode

Loading…
Cancel
Save