mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Merge pull request #3402 from vector-im/fix_3401
Fix Crash on SettingsViewController when Scrolling to Discovery
This commit is contained in:
commit
fb28bb81e9
2 changed files with 13 additions and 2 deletions
|
@ -32,6 +32,7 @@ Bug fix:
|
|||
* Xcode11: Disable voip background mode to avoid VoIP pushes (#3369).
|
||||
* Xcode11: Disable key backup on push extension (#3371).
|
||||
* RoomMembershipBubbleCell: Fix message textview leading constraint (#3226).
|
||||
* SettingsViewController: Fix crash when scrolling to Discovery (#3401).
|
||||
|
||||
Changes in 0.11.6 (2020-06-30)
|
||||
===============================================
|
||||
|
|
|
@ -2470,8 +2470,18 @@ SettingsIdentityServerCoordinatorBridgePresenterDelegate>
|
|||
}
|
||||
else if (section == SETTINGS_SECTION_USER_SETTINGS_INDEX && row == userSettingsThreePidsInformation)
|
||||
{
|
||||
NSIndexPath *discoveryIndexPath = [NSIndexPath indexPathForRow:0 inSection:SETTINGS_SECTION_DISCOVERY_INDEX];
|
||||
[tableView scrollToRowAtIndexPath:discoveryIndexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
|
||||
// settingsDiscoveryTableViewSection is a dynamic section, so check number of rows before scroll to avoid crashes
|
||||
if (self.settingsDiscoveryTableViewSection.numberOfRows > 0)
|
||||
{
|
||||
NSIndexPath *discoveryIndexPath = [NSIndexPath indexPathForRow:0 inSection:SETTINGS_SECTION_DISCOVERY_INDEX];
|
||||
[tableView scrollToRowAtIndexPath:discoveryIndexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
// this won't be precise in scroll location, but seems the best option for now
|
||||
NSIndexPath *discoveryIndexPath = [NSIndexPath indexPathForRow:0 inSection:SETTINGS_SECTION_DISCOVERY_INDEX + 1];
|
||||
[tableView scrollToRowAtIndexPath:discoveryIndexPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
|
||||
}
|
||||
}
|
||||
else if (section == SETTINGS_SECTION_DISCOVERY_INDEX)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue