mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-01 13:46:57 +02:00
Merge branch 'master' of https://github.com/vector-im/element-ios into feature/3269_merge_element_1_8_18
# Conflicts: # Config/AppIdentifiers.xcconfig # Config/AppVersion.xcconfig # Podfile # Podfile.lock # Riot/Assets/de.lproj/Vector.strings # Riot/Generated/Images.swift # Riot/Modules/Analytics/DecryptionFailureTracker.m # Riot/Modules/Application/LegacyAppDelegate.h # Riot/Modules/Onboarding/OnboardingCoordinator.swift # Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift # Riot/Modules/Room/RoomViewController.m # Riot/SupportingFiles/Info.plist # Riot/Utils/EventFormatter.m # Riot/Utils/Tools.h # Riot/Utils/Tools.m # Riot/target.yml # RiotSwiftUI/Modules/Common/Mock/MockAppScreens.swift # fastlane/Fastfile # project.yml
This commit is contained in:
@@ -351,6 +351,12 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||
// the selected room (if any) is highlighted.
|
||||
[self refreshCurrentSelectedCell:YES];
|
||||
}
|
||||
|
||||
if (self.recentsDataSource)
|
||||
{
|
||||
[self refreshRecentsTable];
|
||||
[self showEmptyViewIfNeeded];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewDidLayoutSubviews
|
||||
@@ -1088,8 +1094,12 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||
}
|
||||
else
|
||||
{
|
||||
MXLogDebug(@"[RecentsViewController]: Reloading table view section %ld", indexPath.section);
|
||||
[self.recentsTableView reloadSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationNone];
|
||||
// Ideally we would call tableView.reloadSections, but this can lead to crashes if multiple sections need such an update and they
|
||||
// vertically depend on each other. It is unclear whether this is due to further issues in the data model (e.g. data race)
|
||||
// or some undocumented table view behavior. To avoid this we reload the entire table view, even if this means reloading
|
||||
// multiple times for several section updates.
|
||||
MXLogDebug(@"[RecentsViewController]: Reloading the entire table view due to updates in section %ld", indexPath.section);
|
||||
[self refreshRecentsTable];
|
||||
}
|
||||
}
|
||||
else if (!changes)
|
||||
@@ -2207,11 +2217,15 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||
cellData = [self.dataSource cellDataAtIndexPath:nextIndexPath];
|
||||
}
|
||||
|
||||
if (!cellData && [self.recentsTableView numberOfRowsInSection:section] > 0)
|
||||
if (!cellData && section < self.recentsTableView.numberOfSections && [self.recentsTableView numberOfRowsInSection:section] > 0)
|
||||
{
|
||||
// Scroll back to the top.
|
||||
[self.recentsTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:section] atScrollPosition:UITableViewScrollPositionTop animated:YES];
|
||||
}
|
||||
else if (section >= self.recentsTableView.numberOfSections)
|
||||
{
|
||||
MXLogFailure(@"[RecentsViewController] Section %ld is invalid in a table view with only %ld sections", section, self.recentsTableView.numberOfSections);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2276,6 +2290,18 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||
state:UIControlStateNormal];
|
||||
}
|
||||
|
||||
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
|
||||
{
|
||||
[self.recentsSearchBar resignFirstResponder];
|
||||
[self hideSearchBar:YES];
|
||||
self.recentsTableView.contentOffset = CGPointMake(0, self.recentsSearchBar.frame.size.height);
|
||||
self.recentsTableView.tableHeaderView = nil;
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self.recentsDataSource searchWithPatterns:nil];
|
||||
[self.recentsSearchBar setText:nil];
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark - CreateRoomCoordinatorBridgePresenterDelegate
|
||||
|
||||
- (void)createRoomCoordinatorBridgePresenterDelegate:(CreateRoomCoordinatorBridgePresenter *)coordinatorBridgePresenter didCreateNewRoom:(MXRoom *)room
|
||||
|
||||
Reference in New Issue
Block a user