MESSENGER-5938 activate labs

This commit is contained in:
JanNiklas Grabowski
2024-04-05 13:28:31 +02:00
parent b73534064e
commit d8adcd13c0
4 changed files with 47 additions and 0 deletions
@@ -306,6 +306,9 @@ SSOAuthenticationPresenterDelegate>
// New email address to bind
UITextField* newEmailTextField;
// bwi: #5938 activate lab
int countActivateLabs;
// New phone number to bind
TableViewCellWithPhoneNumberTextField * newPhoneNumberCell;
CountryPickerViewController *newPhoneNumberCountryPicker;
@@ -2755,6 +2758,13 @@ SSOAuthenticationPresenterDelegate>
versionCell.selectionStyle = UITableViewCellSelectionStyleNone;
// bwi: #5938 activate lab
if (!versionCell.gestureRecognizers.count)
{
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onElementVersionTap)];
[versionCell addGestureRecognizer:tap];
}
cell = versionCell;
}
else if (row == ABOUT_TERM_CONDITIONS_INDEX)
@@ -4571,6 +4581,37 @@ SSOAuthenticationPresenterDelegate>
}
}
// bwi: #5938 activate lab
- (void)onElementVersionTap
{
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;
}
}
- (void)showThemePicker
{
__weak typeof(self) weakSelf = self;