mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Settings: Fix crash when logging out
This commit is contained in:
parent
13028a745a
commit
a4e2d62261
1 changed files with 25 additions and 14 deletions
|
@ -561,8 +561,15 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
|
|||
}
|
||||
else if (section == SETTINGS_SECTION_IGNORED_USERS_INDEX)
|
||||
{
|
||||
MXSession* session = [[AppDelegate theDelegate].mxSessions objectAtIndex:0];
|
||||
count = session.ignoredUsers.count;
|
||||
if ([AppDelegate theDelegate].mxSessions.count > 0)
|
||||
{
|
||||
MXSession* session = [[AppDelegate theDelegate].mxSessions objectAtIndex:0];
|
||||
count = session.ignoredUsers.count;
|
||||
}
|
||||
else
|
||||
{
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
else if (section == SETTINGS_SECTION_ADVANCED_INDEX)
|
||||
{
|
||||
|
@ -1027,16 +1034,17 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
|
|||
}
|
||||
else if (section == SETTINGS_SECTION_IGNORED_USERS_INDEX)
|
||||
{
|
||||
MXSession* session = [[AppDelegate theDelegate].mxSessions objectAtIndex:0];
|
||||
if (session.ignoredUsers.count)
|
||||
if ([AppDelegate theDelegate].mxSessions.count > 0)
|
||||
{
|
||||
return NSLocalizedStringFromTable(@"settings_ignored_users", @"Vector", nil);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hide this section
|
||||
return nil;
|
||||
MXSession* session = [[AppDelegate theDelegate].mxSessions objectAtIndex:0];
|
||||
if (session.ignoredUsers.count)
|
||||
{
|
||||
return NSLocalizedStringFromTable(@"settings_ignored_users", @"Vector", nil);
|
||||
}
|
||||
}
|
||||
|
||||
// Hide this section
|
||||
return nil;
|
||||
}
|
||||
else if (section == SETTINGS_SECTION_ADVANCED_INDEX)
|
||||
{
|
||||
|
@ -1108,11 +1116,14 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
|
|||
{
|
||||
if (section == SETTINGS_SECTION_IGNORED_USERS_INDEX)
|
||||
{
|
||||
MXSession* session = [[AppDelegate theDelegate].mxSessions objectAtIndex:0];
|
||||
if (session.ignoredUsers.count == 0)
|
||||
if ([AppDelegate theDelegate].mxSessions.count > 0)
|
||||
{
|
||||
// Hide this section
|
||||
return SECTION_TITLE_PADDING_WHEN_HIDDEN;
|
||||
MXSession* session = [[AppDelegate theDelegate].mxSessions objectAtIndex:0];
|
||||
if (session.ignoredUsers.count == 0)
|
||||
{
|
||||
// Hide this section
|
||||
return SECTION_TITLE_PADDING_WHEN_HIDDEN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue