diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 263d92ee1..ca50fbe7e 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -2902,7 +2902,6 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) { case YapDatabaseViewChangeDelete: { DDLogVerbose(@"YapDatabaseViewChangeDelete: %@, %@", rowChange.collectionKey, rowChange.indexPath); [self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]]; - [rowsThatChangedSize removeObject:@(rowChange.indexPath.row)]; YapCollectionKey *collectionKey = rowChange.collectionKey; OWSAssert(collectionKey.key.length > 0); break; @@ -2930,6 +2929,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) { rowChange.newIndexPath); [self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]]; [self.collectionView insertItemsAtIndexPaths:@[ rowChange.newIndexPath ]]; + [rowsThatChangedSize removeObject:@(rowChange.newIndexPath.row)]; break; } case YapDatabaseViewChangeUpdate: { @@ -2947,7 +2947,9 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) { for (NSNumber *row in rowsThatChangedSize) { [rowsToReload addObject:[NSIndexPath indexPathForRow:row.integerValue inSection:0]]; } - [self.collectionView reloadItemsAtIndexPaths:rowsToReload]; + if (rowsToReload.count > 0) { + [self.collectionView reloadItemsAtIndexPaths:rowsToReload]; + } }; void (^batchUpdatesCompletion)(BOOL) = ^(BOOL finished) { OWSAssert([NSThread isMainThread]);