* Loading animation: Fix the bug where, after authentication, the animation disappeared too early and made auth screen flashed.

This commit is contained in:
manuroe
2020-09-15 16:48:35 +02:00
parent 33a4cf0b25
commit c6c5b4234b
6 changed files with 84 additions and 15 deletions
+19 -1
View File
@@ -31,7 +31,7 @@
#import "Riot-Swift.h"
@interface MasterTabBarController ()
@interface MasterTabBarController () <AuthenticationViewControllerDelegate>
{
// Array of `MXSession` instances.
NSMutableArray *mxSessionArray;
@@ -79,6 +79,8 @@
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
_authenticationInProgress = NO;
// Note: UITabBarViewController shoud not be embed in a UINavigationController (https://github.com/vector-im/riot-ios/issues/3086)
[self vc_removeBackTitle];
@@ -418,6 +420,7 @@
if (!self.authViewController && !isAuthViewControllerPreparing)
{
isAuthViewControllerPreparing = YES;
_authenticationInProgress = YES;
[self resetReviewSessionsFlags];
@@ -464,6 +467,7 @@
if (!self.authViewController && !isAuthViewControllerPreparing)
{
isAuthViewControllerPreparing = YES;
_authenticationInProgress = YES;
[[AppDelegate theDelegate] restoreInitialDisplay:^{
@@ -695,6 +699,9 @@
_authViewController = segue.destinationViewController;
isAuthViewControllerPreparing = NO;
// Listen to the end of the authentication flow
_authViewController.authVCDelegate = self;
authViewControllerObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXKAccountManagerDidAddAccountNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
_authViewController = nil;
@@ -1163,4 +1170,15 @@
}
}
#pragma mark - AuthenticationViewControllerDelegate
- (void)authenticationViewControllerDidDismiss:(AuthenticationViewController *)authenticationViewController
{
_authenticationInProgress = NO;
if (self.masterVCDelegate)
{
[self.masterVCDelegate masterTabBarControllerDidCompleteAuthentication:self];
}
}
@end