mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Go to pin setter screen only if forced at login
This commit is contained in:
parent
07e96fc7cc
commit
e7880b863a
1 changed files with 19 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue