MESSENGER-5938 add condition

This commit is contained in:
JanNiklas Grabowski
2024-04-05 14:01:39 +02:00
parent d8adcd13c0
commit f7911fb100
+27 -24
View File
@@ -4584,31 +4584,34 @@ SSOAuthenticationPresenterDelegate>
// bwi: #5938 activate lab
- (void)onElementVersionTap
{
if (!countActivateLabs) {
countActivateLabs = 0;
}
if (countActivateLabs >= 6)
if (!BWIBuildSettings.shared.settingsScreenShowLabSettings)
{
BWIBuildSettings.shared.settingsScreenShowLabSettings = true;
[self updateSections];
MXWeakify(self);
[currentAlert dismissViewControllerAnimated:NO completion:nil];
UIAlertController *successAlert = [UIAlertController alertControllerWithTitle:[BWIL10n bwiActivateLabsAlertTitle]
message:nil
preferredStyle:UIAlertControllerStyleAlert];
[successAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
}]];
[self presentViewController:successAlert animated:YES completion:nil];
currentAlert = successAlert;
}
else
{
countActivateLabs += 1;
if (!countActivateLabs) {
countActivateLabs = 0;
}
if (countActivateLabs >= 6)
{
BWIBuildSettings.shared.settingsScreenShowLabSettings = true;
[self updateSections];
MXWeakify(self);
[currentAlert dismissViewControllerAnimated:NO completion:nil];
UIAlertController *successAlert = [UIAlertController alertControllerWithTitle:[BWIL10n bwiActivateLabsAlertTitle]
message:nil
preferredStyle:UIAlertControllerStyleAlert];
[successAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
}]];
[self presentViewController:successAlert animated:YES completion:nil];
currentAlert = successAlert;
}
else
{
countActivateLabs += 1;
}
}
}