mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-31 23:47:01 +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 {
|
||||
self.navigationItem.rightBarButtonItem.enabled = !enabled;
|
||||
self.tableView.userInteractionEnabled = !enabled;
|
||||
self.navigationItem.rightBarButtonItem.enabled = enabled;
|
||||
self.tableView.userInteractionEnabled = enabled;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -300,13 +300,18 @@ static NSString* const kBITAuthenticatorDidSkipOptionalLogin = @"BITAuthenticato
|
||||
NSError *authParseError = nil;
|
||||
NSString *authToken = [strongSelf.class authenticationTokenFromReponse:response
|
||||
error:&authParseError];
|
||||
NSError *error = nil;
|
||||
if(nil == authToken) {
|
||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil
|
||||
message:@"Failed to authenticate"
|
||||
delegate:nil
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"OK")
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
if([authParseError.domain isEqualToString:kBITAuthenticatorErrorDomain] &&
|
||||
authParseError.code == BITAuthenticatorNotAuthorized) {
|
||||
error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain
|
||||
code:BITAuthenticatorNotAuthorized
|
||||
userInfo:@{
|
||||
//TODO localize
|
||||
NSLocalizedDescriptionKey : @"Not authorized",
|
||||
NSUnderlyingErrorKey : authParseError
|
||||
}];
|
||||
}
|
||||
completion(NO, error);
|
||||
} else {
|
||||
//no need to call completion, we're dismissing it anyways
|
||||
|
Loading…
x
Reference in New Issue
Block a user