Skip to content

Commit

Permalink
Merge pull request #394 from wordpress-mobile/fix-incremental-update
Browse files Browse the repository at this point in the history
Fix incremental update
  • Loading branch information
crazytonyli authored Sep 8, 2022
2 parents f25ed67 + 61afeb2 commit 817576c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 36 deletions.
31 changes: 4 additions & 27 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,10 @@
All notable changes to this project will be documented in this file.
`WPMediaPicker` adheres to [Semantic Versioning](http://semver.org/).

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

---
## [1.8.1](https://github.com/wordpress-mobile/MediaPicker-iOS/releases/tag/1.8.1)
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- WPMediaPicker (1.8.4)
- WPMediaPicker (1.8.5)

DEPENDENCIES:
- WPMediaPicker (from `../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
WPMediaPicker: 9533160e5587939876aeeb1461a441a4e5dc4c4d
WPMediaPicker: 5a74a91e11c1047e942a65de0193f93432fc2c6d

PODFILE CHECKSUM: 31590cb12765a73c9da27d6ea5b8b127c095d71d

Expand Down
10 changes: 4 additions & 6 deletions Pod/Classes/WPMediaPickerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -682,16 +682,14 @@ - (void)updateDataWithRemoved:(NSIndexSet *)removed inserted:(NSIndexSet *)inser
}
__weak __typeof__(self) weakSelf = self;
[self.collectionView performBatchUpdates:^{
if (removed) {
if ([removed count] > 0) {
[self.collectionView deleteItemsAtIndexPaths:[self indexPathsFromIndexSet:removed section:0]];
}
if (inserted) {
if ([inserted count] > 0) {
[self.collectionView insertItemsAtIndexPaths:[self indexPathsFromIndexSet:inserted section:0]];
}
NSArray<NSIndexPath *> *indexPaths = [self indexPathsFromIndexSet:changed section:0];
for (NSIndexPath *indexPath in indexPaths) {
WPMediaCollectionViewCell *cell = (WPMediaCollectionViewCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
[self configureCell:cell forIndexPath:indexPath];
if ([changed count] > 0) {
[self.collectionView reloadItemsAtIndexPaths:[self indexPathsFromIndexSet:changed section:0]];
}
for (id<WPMediaMove> move in moves) {
[self.collectionView moveItemAtIndexPath:[NSIndexPath indexPathForItem:[move from] inSection:0]
Expand Down
2 changes: 1 addition & 1 deletion WPMediaPicker.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Pod::Spec.new do |s|
s.name = 'WPMediaPicker'
s.version = '1.8.4'
s.version = '1.8.5'

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

0 comments on commit 817576c

Please sign in to comment.