Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent 35f058c46a
commit 376e2cc1db

@ -3215,7 +3215,6 @@ typedef enum : NSUInteger {
// We need to reload any modified interactions _before_ we call
// reloadViewItems.
BOOL hasDeletions = NO;
BOOL hasMalformedRowChange = NO;
for (YapDatabaseViewRowChange *rowChange in rowChanges) {
switch (rowChange.type) {
@ -3245,7 +3244,6 @@ typedef enum : NSUInteger {
} else {
hasMalformedRowChange = YES;
}
hasDeletions = YES;
break;
}
default:
@ -3264,7 +3262,6 @@ typedef enum : NSUInteger {
[self.collectionView reloadData];
self.lastReloadDate = [NSDate new];
[self updateLastVisibleTimestamp];
[self cleanUpUnreadIndicatorIfNecessary];
return;
}
@ -3349,9 +3346,6 @@ typedef enum : NSUInteger {
if (scrollToBottom) {
[self scrollToBottomAnimated:shouldAnimateScrollToBottom && shouldAnimateUpdates];
}
if (hasDeletions) {
[self cleanUpUnreadIndicatorIfNecessary];
}
};
if (shouldAnimateUpdates) {
[self.collectionView performBatchUpdates:batchUpdates completion:batchUpdatesCompletion];
@ -3785,17 +3779,6 @@ typedef enum : NSUInteger {
self.hasUnreadMessages = numberOfUnreadMessages > 0;
}
- (void)cleanUpUnreadIndicatorIfNecessary
{
BOOL hasUnreadIndicator = self.dynamicInteractions.unreadIndicator != nil;
if (!hasUnreadIndicator) {
return;
}
// If the last unread message was deleted (manually or due to disappearing messages)
// we may need to clean up an obsolete unread indicator.
[self ensureDynamicInteractions];
}
- (void)updateLastVisibleTimestamp:(uint64_t)timestamp
{
OWSAssert(timestamp > 0);
@ -4924,6 +4907,11 @@ typedef enum : NSUInteger {
viewItem.shouldHideFooter = shouldHideFooter;
viewItem.senderName = senderName;
}
if (unreadIndicator) {
// This isn't necessarily a bug - all of the interactions after the
// unread indicator may have disappeared or been deleted.
DDLogWarn(@"%@ Couldn't find an interaction to hang the unread indicator on.", self.logTag);
}
self.viewItems = viewItems;
self.viewItemCache = viewItemCache;

@ -567,7 +567,7 @@ NS_ASSUME_NONNULL_BEGIN
if (!interactionAfterUnreadIndicator) {
// If we can't find an interaction after the unread indicator,
// remove it. All unread messages may have been deleted or
// don't show it. All unread messages may have been deleted or
// expired.
return;
}

Loading…
Cancel
Save