mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
Fix potentially redundant table reloading.
This commit is contained in:
@@ -97,10 +97,17 @@ const CGFloat kTypingCellHeight = 24;
|
||||
}];
|
||||
|
||||
// Observe URL preview updates.
|
||||
kURLPreviewDidUpdateNotificationObserver = [NSNotificationCenter.defaultCenter addObserverForName:URLPreviewDidUpdateNotification object:nil queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) {
|
||||
kURLPreviewDidUpdateNotificationObserver = [NSNotificationCenter.defaultCenter addObserverForName:URLPreviewDidUpdateNotification object:nil queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull notification) {
|
||||
|
||||
// Refresh all cells.
|
||||
[self refreshCells];
|
||||
if (![(NSString*)notification.userInfo[@"roomId"] isEqualToString:self.roomId] || !self.delegate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Refresh the updated cell.
|
||||
// Note - it doesn't appear as though MXKRoomViewController actually uses the index path.
|
||||
NSInteger index = [self indexOfCellDataWithEventId:(NSString*)notification.userInfo[@"eventId"]];
|
||||
[self.delegate dataSource:self didCellChange:[NSIndexPath indexPathWithIndex:index]];
|
||||
}];
|
||||
|
||||
[self registerKeyVerificationRequestNotification];
|
||||
|
||||
Reference in New Issue
Block a user