MESSENGER-5556 fix maintenance sync

This commit is contained in:
JanNiklas Grabowski
2024-03-20 14:05:18 +01:00
parent 01e3255631
commit 60ca0cab30
15 changed files with 221 additions and 105 deletions
@@ -2475,8 +2475,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
#pragma mark - Bwi Check App version
- (void)checkAppVersionDeprecated {
ValidAppVersionsDefaultService *appVersionsService = [[ValidAppVersionsDefaultService alloc] init];
if( BWIBuildSettings.shared.bwiCheckAppVersion && appVersionsService.isCurrentAppVersionDeprecated ) {
if( BWIBuildSettings.shared.bwiCheckAppVersion && ValidAppVersionsDefaultService.shared.isCurrentAppVersionDeprecated ) {
MXWeakify(self);
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[BWIL10n bwiOutdatedVersionWarningTitle]
@@ -2498,8 +2497,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
}
- (void)checkAppVersionOutdated {
ValidAppVersionsDefaultService *appVersionsService = [[ValidAppVersionsDefaultService alloc] init];
if (BWIBuildSettings.shared.bwiCheckAppVersion && appVersionsService.isCurrentAppVersionOutdated && !appVersionsService.wasOutdatedAlertShown) {
if (BWIBuildSettings.shared.bwiCheckAppVersion && ValidAppVersionsDefaultService.shared.isCurrentAppVersionOutdated && !ValidAppVersionsDefaultService.shared.wasOutdatedAlertShown) {
MXWeakify(self);
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[BWIL10n bwiOutdatedVersionWarningTitle]
message:[BWIL10n bwiOutdatedVersionWarningMessage:AppInfo.current.displayName]
@@ -2510,7 +2508,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
handler:^(UIAlertAction * action) {
[self gotoAppStore];
[appVersionsService setOutdatedAlertShown:true];
[ValidAppVersionsDefaultService.shared setOutdatedAlertShown:true];
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
@@ -2519,15 +2517,15 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
[errorAlert addAction:[UIAlertAction actionWithTitle:[BWIL10n bwiOutdatedVersionLogoutButton]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[appVersionsService setOutdatedAlertShown:true];
[ValidAppVersionsDefaultService.shared setOutdatedAlertShown:true];
}]];
[self presentViewController:errorAlert animated:YES completion:nil];
}
// bwi #5276: if outdated was shown but our app version is valid that means we have updated and have to reset outdated shown
if (BWIBuildSettings.shared.bwiCheckAppVersion && !appVersionsService.isCurrentAppVersionOutdated && appVersionsService.wasOutdatedAlertShown) {
[appVersionsService setOutdatedAlertShown:false];
if (BWIBuildSettings.shared.bwiCheckAppVersion && !ValidAppVersionsDefaultService.shared.isCurrentAppVersionOutdated && ValidAppVersionsDefaultService.shared.wasOutdatedAlertShown) {
[ValidAppVersionsDefaultService.shared setOutdatedAlertShown:false];
}
}