fix IGListKit updates logging

Summary:
* Issue: we don't log the IGListKit updates
* Cause: IGListAdapterUpdater clears the ongoing updates before we call the delegate (https://fburl.com/76w5wvpl)
* Fix: keep a hold of the updates before calling executeCompletionBlocks(...)

Reviewed By: rnystrom

Differential Revision: D6750327

fbshipit-source-id: a30572873ab753b067977288cdb465a2a222e715
This commit is contained in:
Maxime Ollivier 2018-01-18 13:04:26 -08:00 committed by Facebook Github Bot
parent a8275e08e1
commit 17c4d02119

View file

@ -190,9 +190,10 @@
// block used as the second param of -[UICollectionView performBatchUpdates:completion:]
void (^batchUpdatesCompletionBlock)(BOOL) = ^(BOOL finished) {
IGListBatchUpdateData *oldApplyingUpdateData = self.applyingUpdateData;
executeCompletionBlocks(finished);
[delegate listAdapterUpdater:self didPerformBatchUpdates:(id)self.applyingUpdateData collectionView:collectionView];
[delegate listAdapterUpdater:self didPerformBatchUpdates:oldApplyingUpdateData collectionView:collectionView];
// queue another update in case something changed during batch updates. this method will bail next runloop if
// there are no changes