mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
Key backup: avoid to refresh the home room list on every backup state change
A possible mitigation for #2265
This commit is contained in:
@@ -165,10 +165,13 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
|
||||
- (void)keyBackupStateDidChangeNotification:(NSNotification*)notification
|
||||
{
|
||||
[self forceRefresh];
|
||||
if ([self updateKeyBackupBanner])
|
||||
{
|
||||
[self forceRefresh];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateKeyBackupBanner
|
||||
- (BOOL)updateKeyBackupBanner
|
||||
{
|
||||
KeyBackupBanner keyBackupBanner = KeyBackupBannerNone;
|
||||
|
||||
@@ -207,8 +210,12 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BOOL updated = (self.keyBackupBanner != keyBackupBanner);
|
||||
|
||||
self.keyBackupBanner = keyBackupBanner;
|
||||
|
||||
return updated;
|
||||
}
|
||||
|
||||
- (void)hideKeyBackupBanner:(KeyBackupBanner)keyBackupBanner
|
||||
@@ -1227,6 +1234,8 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
|
||||
- (void)refreshRoomsSections
|
||||
{
|
||||
NSDate *startDate = [NSDate date];
|
||||
|
||||
[invitesCellDataArray removeAllObjects];
|
||||
[favoriteCellDataArray removeAllObjects];
|
||||
[peopleCellDataArray removeAllObjects];
|
||||
@@ -1240,8 +1249,6 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
|
||||
keyBackupBannerSection = directorySection = favoritesSection = peopleSection = conversationSection = lowPrioritySection = serverNoticeSection = invitesSection = -1;
|
||||
|
||||
[self updateKeyBackupBanner];
|
||||
|
||||
if (displayedRecentsDataSourceArray.count > 0)
|
||||
{
|
||||
// FIXME manage multi accounts
|
||||
@@ -1485,6 +1492,8 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
NSLog(@"[RecentsDataSource] refreshRoomsSections: Done in %.0fms", [[NSDate date] timeIntervalSinceDate:startDate] * 1000);
|
||||
}
|
||||
|
||||
- (void)dataSource:(MXKDataSource*)dataSource didCellChange:(id)changes
|
||||
|
||||
Reference in New Issue
Block a user