mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
fix auth-viewcontroller unusable after failed authentication
This commit is contained in:
parent
34bf1bf611
commit
1938e480cc
@ -294,8 +294,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void) setLoginUIEnabled:(BOOL) enabled {
|
- (void) setLoginUIEnabled:(BOOL) enabled {
|
||||||
self.navigationItem.rightBarButtonItem.enabled = !enabled;
|
self.navigationItem.rightBarButtonItem.enabled = enabled;
|
||||||
self.tableView.userInteractionEnabled = !enabled;
|
self.tableView.userInteractionEnabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -300,13 +300,18 @@ static NSString* const kBITAuthenticatorDidSkipOptionalLogin = @"BITAuthenticato
|
|||||||
NSError *authParseError = nil;
|
NSError *authParseError = nil;
|
||||||
NSString *authToken = [strongSelf.class authenticationTokenFromReponse:response
|
NSString *authToken = [strongSelf.class authenticationTokenFromReponse:response
|
||||||
error:&authParseError];
|
error:&authParseError];
|
||||||
|
NSError *error = nil;
|
||||||
if(nil == authToken) {
|
if(nil == authToken) {
|
||||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil
|
if([authParseError.domain isEqualToString:kBITAuthenticatorErrorDomain] &&
|
||||||
message:@"Failed to authenticate"
|
authParseError.code == BITAuthenticatorNotAuthorized) {
|
||||||
delegate:nil
|
error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain
|
||||||
cancelButtonTitle:BITHockeyLocalizedString(@"OK")
|
code:BITAuthenticatorNotAuthorized
|
||||||
otherButtonTitles:nil];
|
userInfo:@{
|
||||||
[alert show];
|
//TODO localize
|
||||||
|
NSLocalizedDescriptionKey : @"Not authorized",
|
||||||
|
NSUnderlyingErrorKey : authParseError
|
||||||
|
}];
|
||||||
|
}
|
||||||
completion(NO, error);
|
completion(NO, error);
|
||||||
} else {
|
} else {
|
||||||
//no need to call completion, we're dismissing it anyways
|
//no need to call completion, we're dismissing it anyways
|
||||||
|
Loading…
x
Reference in New Issue
Block a user