Go to pin setter screen only if forced at login

This commit is contained in:
ismailgulek 2020-07-21 16:14:46 +03:00
parent 07e96fc7cc
commit e7880b863a
No known key found for this signature in database
GPG key ID: E96336D42D9470A9

View file

@ -883,21 +883,16 @@
- (void)onSuccessfulLogin:(MXCredentials*)credentials
{
// if really login
if (self.authType == MXKAuthenticationTypeLogin)
// if really login and pin protection is forced
if (self.authType == MXKAuthenticationTypeLogin && [PinCodePreferences shared].forcePinProtection)
{
loginCredentials = credentials;
BOOL forcePinProtection = [[NSUserDefaults standardUserDefaults] boolForKey:@"forcePINProtection"];
if (forcePinProtection)
{
SetPinCoordinatorBridgePresenter *presenter = [[SetPinCoordinatorBridgePresenter alloc] initWithSession:nil];
presenter.delegate = self;
[presenter presentFrom:self animated:YES];
self.setPinCoordinatorBridgePresenter = presenter;
return;
}
SetPinCoordinatorBridgePresenter *presenter = [[SetPinCoordinatorBridgePresenter alloc] initWithSession:nil viewMode:SetPinCoordinatorViewModeSetPin];
presenter.delegate = self;
[presenter presentFrom:self animated:YES];
self.setPinCoordinatorBridgePresenter = presenter;
return;
}
[self afterSetPinFlowCompletedWithCredentials:credentials];
@ -1407,4 +1402,16 @@
[self afterSetPinFlowCompletedWithCredentials:loginCredentials];
}
- (void)setPinCoordinatorBridgePresenterDelegateDidCancel:(SetPinCoordinatorBridgePresenter *)coordinatorBridgePresenter
{
// enable the view again
[self setUserInteractionEnabled:YES];
// stop the spinner
[self.authenticationActivityIndicator stopAnimating];
// then, just close the enter pin screen
[coordinatorBridgePresenter dismissWithAnimated:YES completion:nil];
}
@end