File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
WooCommerce/Classes/ViewRelated/Products/Media Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -123,8 +123,14 @@ extension ProductImagesCollectionViewController {
123123 return
124124 }
125125
126+ let selectedImageIndex : Int = {
127+ // In case of any pending images, deduct the number of pending images from the index.
128+ let imageStatusIndex = indexPath. row
129+ let numberOfPendingImages = productImageStatuses. count - productImageStatuses. images. count
130+ return imageStatusIndex - numberOfPendingImages
131+ } ( )
126132 let productImagesGalleryViewController = ProductImagesGalleryViewController ( images: productImageStatuses. images,
127- selectedIndex: indexPath . row ,
133+ selectedIndex: selectedImageIndex ,
128134 isDeletionEnabled: isDeletionEnabled,
129135 productUIImageLoader: productUIImageLoader) { [ weak self] ( productImage) in
130136 self ? . onDeletion ( productImage)
You can’t perform that action at this time.
0 commit comments