mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
RoomsViewController: Crash in [RoomsViewController prepareForSegue:sender:]_block_invoke_2 (in Riot) (RoomsViewController.m:182)
https://github.com/matrix-org/riot-ios-rageshakes/issues/290
This commit is contained in:
parent
391712e2df
commit
633abccce1
1 changed files with 23 additions and 10 deletions
|
@ -156,34 +156,47 @@
|
|||
NSArray<NSString*> *roomDirectoryServers = [[NSUserDefaults standardUserDefaults] objectForKey:@"roomDirectoryServers"];
|
||||
directoryServersDataSource.roomDirectoryServers = roomDirectoryServers;
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
|
||||
[directoryServerPickerViewController displayWithDataSource:directoryServersDataSource onComplete:^(id<MXKDirectoryServerCellDataStoring> cellData) {
|
||||
if (cellData)
|
||||
if (weakSelf && cellData)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
|
||||
// Use the selected directory server
|
||||
if (cellData.thirdPartyProtocolInstance)
|
||||
{
|
||||
recentsDataSource.publicRoomsDirectoryDataSource.thirdpartyProtocolInstance = cellData.thirdPartyProtocolInstance;
|
||||
self->recentsDataSource.publicRoomsDirectoryDataSource.thirdpartyProtocolInstance = cellData.thirdPartyProtocolInstance;
|
||||
}
|
||||
else if (cellData.homeserver)
|
||||
{
|
||||
recentsDataSource.publicRoomsDirectoryDataSource.includeAllNetworks = cellData.includeAllNetworks;
|
||||
recentsDataSource.publicRoomsDirectoryDataSource.homeserver = cellData.homeserver;
|
||||
self->recentsDataSource.publicRoomsDirectoryDataSource.includeAllNetworks = cellData.includeAllNetworks;
|
||||
self->recentsDataSource.publicRoomsDirectoryDataSource.homeserver = cellData.homeserver;
|
||||
}
|
||||
|
||||
// Refresh data
|
||||
[self addSpinnerFooterView];
|
||||
|
||||
[recentsDataSource.publicRoomsDirectoryDataSource paginate:^(NSUInteger roomsAdded) {
|
||||
[self->recentsDataSource.publicRoomsDirectoryDataSource paginate:^(NSUInteger roomsAdded) {
|
||||
|
||||
// The table view is automatically filled
|
||||
[self removeSpinnerFooterView];
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
|
||||
// Make the directory section appear full-page
|
||||
[self.recentsTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:recentsDataSource.directorySection] atScrollPosition:UITableViewScrollPositionTop animated:YES];
|
||||
// The table view is automatically filled
|
||||
[self removeSpinnerFooterView];
|
||||
|
||||
// Make the directory section appear full-page
|
||||
[self.recentsTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:self->recentsDataSource.directorySection] atScrollPosition:UITableViewScrollPositionTop animated:YES];
|
||||
}
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
|
||||
[self removeSpinnerFooterView];
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
[self removeSpinnerFooterView];
|
||||
}
|
||||
}];
|
||||
}
|
||||
}];
|
||||
|
|
Loading…
Reference in a new issue