mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Run UI code in authenticator completions on main queue
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
[self updateBarButtons];
|
||||
[self updateWebLoginButton];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void) updateWebLoginButton {
|
||||
@@ -279,7 +279,7 @@
|
||||
[self saveAction:nil];
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
@@ -294,24 +294,26 @@
|
||||
if(succeeded) {
|
||||
//controller should dismiss us shortly..
|
||||
} else {
|
||||
/* We won't use this for now until we have a more robust solution for displaying UIAlertController
|
||||
// requires iOS 8
|
||||
id uialertcontrollerClass = NSClassFromString(@"UIAlertController");
|
||||
if (uialertcontrollerClass) {
|
||||
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil
|
||||
message:error.localizedDescription
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
|
||||
UIAlertAction *okAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"OK")
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:^(UIAlertAction * action) {}];
|
||||
|
||||
[alertController addAction:okAction];
|
||||
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
} else {
|
||||
*/
|
||||
/* We won't use this for now until we have a more robust solution for displaying UIAlertController
|
||||
// requires iOS 8
|
||||
id uialertcontrollerClass = NSClassFromString(@"UIAlertController");
|
||||
if (uialertcontrollerClass) {
|
||||
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil
|
||||
message:error.localizedDescription
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
|
||||
UIAlertAction *okAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"OK")
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:^(UIAlertAction * action) {}];
|
||||
|
||||
[alertController addAction:okAction];
|
||||
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
} else {
|
||||
*/
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil
|
||||
@@ -321,9 +323,10 @@
|
||||
otherButtonTitles:nil];
|
||||
[alertView show];
|
||||
#pragma clang diagnostic pop
|
||||
/*}*/
|
||||
typeof(self) strongSelf = weakSelf;
|
||||
[strongSelf setLoginUIEnabled:YES];
|
||||
/*}*/
|
||||
typeof(self) strongSelf = weakSelf;
|
||||
[strongSelf setLoginUIEnabled:YES];
|
||||
});
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user