Introduce roomListDataReady on HomeViewController

This commit is contained in:
ismailgulek
2021-09-07 18:22:54 +03:00
parent d4f3463915
commit cd6d642dce
2 changed files with 30 additions and 0 deletions
+20
View File
@@ -26,6 +26,8 @@
#import "MXRoom+Riot.h"
NSString *const HomeViewControllerRoomListDataReadyNotification = @"HomeViewControllerRoomListDataReadyNotification";
@interface HomeViewController () <SecureBackupSetupCoordinatorBridgePresenterDelegate>
{
RecentsDataSource *recentsDataSource;
@@ -46,6 +48,8 @@
@property (nonatomic, strong) CrossSigningSetupBannerCell *keyVerificationSetupBannerPrototypeCell;
@property (nonatomic, strong) CrossSigningSetupCoordinatorBridgePresenter *crossSigningSetupCoordinatorBridgePresenter;
@property (nonatomic, assign, readwrite) BOOL roomListDataReady;
@end
@implementation HomeViewController
@@ -72,6 +76,8 @@
{
[super viewDidLoad];
self.roomListDataReady = NO;
self.view.accessibilityIdentifier = @"HomeVCView";
self.recentsTableView.accessibilityIdentifier = @"HomeVCTableView";
@@ -859,4 +865,18 @@
+ recentsDataSource.serverNoticeCellDataArray.count;
}
- (void)dataSource:(MXKDataSource *)dataSource didCellChange:(id)changes
{
[super dataSource:dataSource didCellChange:changes];
if (dataSource.state == MXKDataSourceStateReady)
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
self.roomListDataReady = YES;
[[NSNotificationCenter defaultCenter] postNotificationName:HomeViewControllerRoomListDataReadyNotification object:nil];
});
}
}
@end