Skip to content

Commit 817576c

Browse files
authored
Merge pull request #394 from wordpress-mobile/fix-incremental-update
Fix incremental update
2 parents f25ed67 + 61afeb2 commit 817576c

File tree

4 files changed

+11
-36
lines changed

4 files changed

+11
-36
lines changed

CHANGELOG.md

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,10 @@
22
All notable changes to this project will be documented in this file.
33
`WPMediaPicker` adheres to [Semantic Versioning](http://semver.org/).
44

5-
#### Releases
6-
- `1.8.1` Release - [1.8.1](#1.8.1)
7-
- `1.8.0` Release - [1.8](#1.8.0)
8-
- `1.7.0` Release - [1.7](#1.7.0)
9-
- `1.6.0` Release - [1.6](#1.6.0)
10-
- `1.5.0` Release - [1.5](#1.5.0)
11-
- `1.4.2` Release - [1.4.2](#1.4.2)
12-
- `1.4` Release - [1.4](#1.4)
13-
- `1.3.4` Release - [1.3.4](#1.3.4)
14-
- `1.3` Release - [1.3](#1.3)
15-
- `1.2` Release - [1.2](#1.2)
16-
- `1.1` Release - [1.1](#1.1)
17-
- `1.0` Release - [1.0](#1.0)
18-
- `0.28` Release - [0.28](#28)
19-
- `0.27` Release - [0.27](#27)
20-
- `0.26` Release - [0.26](#26)
21-
- `0.25` Release - [0.25](#25)
22-
- `0.24` Release - [0.24](#24)
23-
- `0.23` Release - [0.23](#23)
24-
- `0.22` Release - [0.22](#22)
25-
- `0.21` Release - [0.21](#21)
26-
- `0.20` Release - [0.20](#20)
27-
- `0.19` Release - [0.19](#19)
28-
- `0.18` Releases - [0.18](#18)
29-
- `0.17` Releases - [0.17](#17)
30-
- `0.16` Releases - [0.16](#16)
31-
- `0.15` Releases - [0.15](#15)
5+
---
6+
## [1.8.5](https://github.com/wordpress-mobile/MediaPicker-iOS/releases/tag/1.8.5)
7+
### Changes
8+
- Fix issue where incorrect thumbnails are displayed during incremental updates.
329

3310
---
3411
## [1.8.1](https://github.com/wordpress-mobile/MediaPicker-iOS/releases/tag/1.8.1)

Example/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- WPMediaPicker (1.8.4)
2+
- WPMediaPicker (1.8.5)
33

44
DEPENDENCIES:
55
- WPMediaPicker (from `../`)
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
99
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
WPMediaPicker: 9533160e5587939876aeeb1461a441a4e5dc4c4d
12+
WPMediaPicker: 5a74a91e11c1047e942a65de0193f93432fc2c6d
1313

1414
PODFILE CHECKSUM: 31590cb12765a73c9da27d6ea5b8b127c095d71d
1515

Pod/Classes/WPMediaPickerViewController.m

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -682,16 +682,14 @@ - (void)updateDataWithRemoved:(NSIndexSet *)removed inserted:(NSIndexSet *)inser
682682
}
683683
__weak __typeof__(self) weakSelf = self;
684684
[self.collectionView performBatchUpdates:^{
685-
if (removed) {
685+
if ([removed count] > 0) {
686686
[self.collectionView deleteItemsAtIndexPaths:[self indexPathsFromIndexSet:removed section:0]];
687687
}
688-
if (inserted) {
688+
if ([inserted count] > 0) {
689689
[self.collectionView insertItemsAtIndexPaths:[self indexPathsFromIndexSet:inserted section:0]];
690690
}
691-
NSArray<NSIndexPath *> *indexPaths = [self indexPathsFromIndexSet:changed section:0];
692-
for (NSIndexPath *indexPath in indexPaths) {
693-
WPMediaCollectionViewCell *cell = (WPMediaCollectionViewCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
694-
[self configureCell:cell forIndexPath:indexPath];
691+
if ([changed count] > 0) {
692+
[self.collectionView reloadItemsAtIndexPaths:[self indexPathsFromIndexSet:changed section:0]];
695693
}
696694
for (id<WPMediaMove> move in moves) {
697695
[self.collectionView moveItemAtIndexPath:[NSIndexPath indexPathForItem:[move from] inSection:0]

WPMediaPicker.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |s|
44
s.name = 'WPMediaPicker'
5-
s.version = '1.8.4'
5+
s.version = '1.8.5'
66

77
s.summary = 'WPMediaPicker is an iOS controller that allows capture and picking of media assets.'
88
s.description = <<-DESC

0 commit comments

Comments
 (0)