Merge branch 'mkirk/fix-hidden-searchbar' into release/2.27.0

pull/1/head
Michael Kirk 7 years ago
commit b4bda29d11

@ -529,10 +529,16 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
self.isViewVisible = YES; self.isViewVisible = YES;
BOOL isShowingSearchResults = !self.searchResultsController.view.hidden;
if (isShowingSearchResults) {
OWSAssert(self.searchBar.text.ows_stripped.length > 0);
self.tableView.contentOffset = CGPointZero;
} else if (self.lastThread) {
OWSAssert(self.searchBar.text.ows_stripped.length == 0);
// When returning to home view, try to ensure that the "last" thread is still // When returning to home view, try to ensure that the "last" thread is still
// visible. The threads often change ordering while in conversation view due // visible. The threads often change ordering while in conversation view due
// to incoming & outgoing messages. // to incoming & outgoing messages.
if (self.lastThread) {
__block NSIndexPath *indexPathOfLastThread = nil; __block NSIndexPath *indexPathOfLastThread = nil;
[self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) { [self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
indexPathOfLastThread = indexPathOfLastThread =

Loading…
Cancel
Save