From b5a836bf281ca623c430cdbc61761e1f47173efc Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 15 Jun 2018 11:38:47 -0400 Subject: [PATCH] Shared ui db connection v. auto load more. --- .../ConversationView/ConversationViewController.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 5ee6e4e31..3aabc4452 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -1065,6 +1065,7 @@ typedef enum : NSUInteger { [self startReadTimer]; [self updateNavigationBarSubtitleLabel]; [self updateBackButtonUnreadCount]; + [self autoLoadMoreIfNecessary]; switch (self.actionOnOpen) { case ConversationViewActionNone: @@ -1082,7 +1083,6 @@ typedef enum : NSUInteger { self.actionOnOpen = ConversationViewActionNone; - self.isViewCompletelyAppeared = YES; self.viewHasEverAppeared = YES; @@ -1557,6 +1557,10 @@ typedef enum : NSUInteger { // // Otherwise, tapping on "load more messages" autoscrolls you downward which is completely wrong. if (hasEarlierUnseenMessages) { + // Ensure view items are updated before trying to scroll to the + // unread indicator. + [[OWSPrimaryStorage sharedManager] updateUIDatabaseConnectionToLatest]; + [self scrollToUnreadIndicatorAnimated]; } }