Room context preview dismissed unexpectedly (#5993)

- fixed
This commit is contained in:
Gil Eluard
2022-04-06 10:43:35 +02:00
committed by GitHub
parent 9d1ddfcbeb
commit f92f5a5f0c
5 changed files with 67 additions and 0 deletions
@@ -83,6 +83,7 @@
{
[super finalizeInit];
_recentsUpdateEnabled = YES;
_enableBarButtonSearch = YES;
}
@@ -169,6 +170,8 @@
// Observe the server sync
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onSyncNotification) name:kMXSessionDidSyncNotification object:nil];
self.recentsUpdateEnabled = YES;
}
- (void)viewWillDisappear:(BOOL)animated
@@ -319,6 +322,10 @@
- (void)refreshRecentsTable
{
if (!self.recentsUpdateEnabled) return;
isRefreshNeeded = NO;
// For now, do a simple full reload
[self.recentsTableView reloadData];
}
@@ -330,6 +337,16 @@
[self.view setNeedsUpdateConstraints];
}
- (void)setRecentsUpdateEnabled:(BOOL)activeUpdate
{
_recentsUpdateEnabled = activeUpdate;
if (_recentsUpdateEnabled && isRefreshNeeded)
{
[self refreshRecentsTable];
}
}
#pragma mark - Action
- (IBAction)search:(id)sender
@@ -385,6 +402,12 @@
- (void)dataSource:(MXKDataSource *)dataSource didCellChange:(id)changes
{
if (!_recentsUpdateEnabled)
{
isRefreshNeeded = YES;
return;
}
// For now, do a simple full reload
[self refreshRecentsTable];
}