Reload section if total number of rooms changes, fixes #5448

This commit is contained in:
ismailgulek
2022-02-02 16:43:52 +03:00
parent de6d2a2fad
commit f86ff9dccc
6 changed files with 66 additions and 15 deletions
@@ -1006,12 +1006,12 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
- (void)dataSource:(MXKDataSource *)dataSource didCellChange:(id)changes
{
BOOL cellReloaded = NO;
if ([changes isKindOfClass:NSNumber.class])
if ([changes isKindOfClass:RecentsSectionUpdate.class])
{
NSInteger section = ((NSNumber *)changes).integerValue;
if (section >= 0)
RecentsSectionUpdate *update = (RecentsSectionUpdate*)changes;
if (update.isValid && !update.totalCountsChanged)
{
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:section];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:update.sectionIndex];
UITableViewCell *cell = [self.recentsTableView cellForRowAtIndexPath:indexPath];
if ([cell isKindOfClass:TableViewCellWithCollectionView.class])
{