From 5fdb88ddf4012643f00e0797220767b9430b833c Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 11 Jan 2019 17:58:32 -0700 Subject: [PATCH] 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 --- .../PhotoLibrary/ImagePickerController.swift | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift index f2ab1e277..57c406c2f 100644 --- a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift +++ b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift @@ -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