Skip to content

Commit

Permalink
Merge pull request #1366 from vector-im/annoying_new_messages_label
Browse files Browse the repository at this point in the history
Bug Fix: blank pages with random "unread msgs" bars whilst they load.
  • Loading branch information
giomfo committed Jun 29, 2017
2 parents de11e8f + b706db6 commit e939c92
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Riot/ViewController/RoomViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -972,10 +972,14 @@ - (void)setBubbleTableViewDisplayInTransition:(BOOL)bubbleTableViewDisplayInTran
{
[super setBubbleTableViewDisplayInTransition:bubbleTableViewDisplayInTransition];

[self refreshActivitiesViewDisplay];

[self checkReadMarkerVisibility];
[self refreshJumpToLastUnreadBannerDisplay];
// Refresh additional displays when the table is ready.
if (!bubbleTableViewDisplayInTransition && !self.bubblesTableView.isHidden)
{
[self refreshActivitiesViewDisplay];

[self checkReadMarkerVisibility];
[self refreshJumpToLastUnreadBannerDisplay];
}
}
}

Expand Down Expand Up @@ -3099,7 +3103,8 @@ - (void)refreshActivitiesViewDisplay
{
// Show "scroll to bottom" icon when the most recent message is not visible,
// or when the timelime is not live (this icon is used to go back to live).
if (!self.roomDataSource.isLive || (!self.bubblesTableView.isHidden && [self isBubblesTableScrollViewAtTheBottom] == NO))
// Note: we check if `currentEventIdAtTableBottom` is set to know whether the table has been rendered at least once.
if (!self.roomDataSource.isLive || (currentEventIdAtTableBottom && [self isBubblesTableScrollViewAtTheBottom] == NO))
{
// Retrieve the unread messages count
NSUInteger unreadCount = self.roomDataSource.room.summary.localUnreadEventCount;
Expand Down

0 comments on commit e939c92

Please sign in to comment.