Hide scroll to bottom when room is left

This commit is contained in:
ismailgulek
2021-04-21 12:50:37 +03:00
parent 056b3f0ab9
commit 7c45bcfc3a
+14 -5
View File
@@ -4487,11 +4487,20 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
// 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;
self.scrollToBottomBadgeLabel.text = unreadCount ? [NSString stringWithFormat:@"%lu", unreadCount] : nil;
self.scrollToBottomHidden = NO;
if (self.roomDataSource.room)
{
// Retrieve the unread messages count
NSUInteger unreadCount = self.roomDataSource.room.summary.localUnreadEventCount;
self.scrollToBottomBadgeLabel.text = unreadCount ? [NSString stringWithFormat:@"%lu", unreadCount] : nil;
self.scrollToBottomHidden = NO;
}
else
{
// will be here for left rooms
self.scrollToBottomBadgeLabel.text = nil;
self.scrollToBottomHidden = YES;
}
}
else if (serverNotices.usageLimit && serverNotices.usageLimit.isServerNoticeUsageLimit)
{