Fix login from non-linphone account button being accessible without accepting the conditions

This commit is contained in:
QuentinArguillere 2022-02-03 18:03:20 +01:00
parent 9dcd761b6d
commit f05416af2b
2 changed files with 4 additions and 3 deletions

View file

@ -58,7 +58,7 @@
@property(nonatomic, strong) IBOutlet UIImageView *welcomeLogoImage;
@property(nonatomic, strong) IBOutlet UIButton *gotoCreateAccountButton;
@property(nonatomic, strong) IBOutlet UIButton *gotoLinphoneLoginButton;
@property(nonatomic, strong) IBOutlet UIView *gotoLinphoneSpecificFeatureWarningButton;
@property(nonatomic, strong) IBOutlet UIButton *gotoLinphoneSpecificFeatureWarningButton;
@property(nonatomic, strong) IBOutlet UIButton *gotoLoginButton;
@property(nonatomic, strong) IBOutlet UIButton *gotoRemoteProvisioningButton;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;

View file

@ -310,7 +310,7 @@ static UICompositeViewDescription *compositeDescription = nil;
BOOL acceptTerms = [LinphoneManager.instance lpConfigBoolForKey:@"accept_terms" withDefault:FALSE];
UIImage *image = acceptTerms ? [UIImage imageNamed:@"checkbox_checked.png"] : [UIImage imageNamed:@"checkbox_unchecked.png"];
[_acceptButton setImage:image forState:UIControlStateNormal];
_gotoRemoteProvisioningButton.enabled = _gotoLinphoneLoginButton.enabled = _gotoCreateAccountButton.enabled = _gotoLoginButton.enabled = acceptTerms;
_gotoRemoteProvisioningButton.enabled = _gotoLinphoneLoginButton.enabled = _gotoCreateAccountButton.enabled = _gotoLinphoneSpecificFeatureWarningButton.enabled = acceptTerms;
}
+ (NSString *)errorForLinphoneAccountCreatorPhoneNumberStatus:(LinphoneAccountCreatorPhoneNumberStatus)status {
@ -1361,12 +1361,13 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun
// Change button color and wait the display of this
#define ONCLICKBUTTON(button, timewaitmsec, body) \
UIColor *previousColor = (UIColor*)[sender backgroundColor]; \
[button setBackgroundColor:[UIColor lightGrayColor]]; \
_waitView.hidden = NO; \
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (timewaitmsec * NSEC_PER_MSEC)); \
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ \
body \
[button setBackgroundColor:[UIColor clearColor]]; \
[button setBackgroundColor:previousColor]; \
_waitView.hidden = YES; \
}); \