Register all database views asynchronously.
This commit is contained in:
parent
5cf89a0f3d
commit
100adae245
|
@ -401,7 +401,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
|
|||
|
||||
[self ensureRootViewController];
|
||||
|
||||
[AppReadiness.sharedManager runNowOrWhenAppIsReady:^{
|
||||
[AppReadiness runNowOrWhenAppIsReady:^{
|
||||
[self handleActivation];
|
||||
}];
|
||||
|
||||
|
@ -768,7 +768,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
|
|||
|
||||
[OWSPreferences setIsRegistered:[TSAccountManager isRegistered]];
|
||||
|
||||
[AppReadiness.sharedManager setAppIsReady];
|
||||
[AppReadiness setAppIsReady];
|
||||
|
||||
if ([TSAccountManager isRegistered]) {
|
||||
DDLogInfo(@"localNumber: %@", [TSAccountManager localNumber]);
|
||||
|
|
|
@ -314,11 +314,6 @@ typedef NSData *_Nullable (^CreateDatabaseMetadataBlock)(void);
|
|||
|
||||
- (BOOL)areAllRegistrationsComplete
|
||||
{
|
||||
DDLogInfo(@"%@ areAllRegistrationsComplete: %d %d = %d",
|
||||
self.logTag,
|
||||
self.areSyncRegistrationsComplete,
|
||||
self.areAsyncRegistrationsComplete,
|
||||
self.areSyncRegistrationsComplete && self.areAsyncRegistrationsComplete);
|
||||
return self.areSyncRegistrationsComplete && self.areAsyncRegistrationsComplete;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,10 +10,17 @@ typedef void (^AppReadyBlock)(void);
|
|||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
// This method can be called on any thread.
|
||||
+ (BOOL)isAppReady;
|
||||
|
||||
// This method should only be called on the main thread.
|
||||
+ (void)setAppIsReady;
|
||||
|
||||
// If the app is ready, the block is called immediately;
|
||||
// otherwise it is called when the app becomes ready.
|
||||
//
|
||||
// This method should only be called on the main thread.
|
||||
// The block will always be called on the main thread.
|
||||
+ (void)runNowOrWhenAppIsReady:(AppReadyBlock)block;
|
||||
|
||||
@end
|
||||
|
|
|
@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
+ (BOOL)isAppReady
|
||||
{
|
||||
return self.sharedManager.isAppReady;
|
||||
return [self.sharedManager isAppReady];
|
||||
}
|
||||
|
||||
+ (void)runNowOrWhenAppIsReady:(AppReadyBlock)block
|
||||
|
|
Loading…
Reference in New Issue