Improve comments and correct iOS version check logic.

This commit is contained in:
David Langley
2021-08-25 15:17:05 +01:00
parent 1164d1c1d8
commit ea38ecc6c7
5 changed files with 39 additions and 30 deletions
+10 -5
View File
@@ -366,17 +366,24 @@ TableViewSectionsDelegate>
{
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_SHOW_DECODED_CONTENT];
}
if (![BuildSettings showNotificationsV2]){
if (@available(iOS 14.0, *)) {
// Don't add Global settings message for iOS 14+
} else {
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_GLOBAL_SETTINGS_INDEX];
}
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_PIN_MISSED_NOTIFICATIONS_INDEX];
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_PIN_UNREAD_INDEX];
if ([BuildSettings showNotificationsV2]){
if (@available(iOS 14.0, *)) {
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_DEFAULT_SETTINGS_INDEX];
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_MENTION_AND_KEYWORDS_SETTINGS_INDEX];
[sectionNotificationSettings addRowWithTag:NOTIFICATION_SETTINGS_OTHER_SETTINGS_INDEX];
} else {
// Don't add new sections on pre iOS 14
}
sectionNotificationSettings.headerTitle = NSLocalizedStringFromTable(@"settings_notifications", @"Vector", nil);
[tmpSections addObject:sectionNotificationSettings];
@@ -4094,7 +4101,7 @@ TableViewSectionsDelegate>
- (void)showNotificationSettings: (NotificationSettingsScreen) screen
{
//New notification screens are only supported on iOS 14+
if (@available(iOS 14.0, *)) {
NotificationSettingsCoordinatorBridgePresenter *notificationSettingsBridgePresenter = [[NotificationSettingsCoordinatorBridgePresenter alloc] initWithSession:self.mainSession];
notificationSettingsBridgePresenter.delegate = self;
@@ -4109,8 +4116,6 @@ TableViewSectionsDelegate>
self.notificationSettingsBridgePresenter = notificationSettingsBridgePresenter;
} else {
// Fallback on earlier versions
}
}