Fix nominal race in "is registered" state.

pull/1/head
Matthew Chen 7 years ago
parent a635a5d1ca
commit 8ce9f3b24d

@ -37,7 +37,7 @@ NSString *const TSAccountManager_ServerSignalingKey = @"TSStorageServerSignaling
@interface TSAccountManager () @interface TSAccountManager ()
@property (nonatomic, readonly) BOOL isRegistered; @property (atomic, readonly) BOOL isRegistered;
// This property is exposed publicly for testing purposes only. // This property is exposed publicly for testing purposes only.
#ifndef DEBUG #ifndef DEBUG
@ -120,9 +120,9 @@ NSString *const TSAccountManager_ServerSignalingKey = @"TSStorageServerSignaling
// Cache this once it's true since it's called alot, involves a dbLookup, and once set - it doesn't change. // Cache this once it's true since it's called alot, involves a dbLookup, and once set - it doesn't change.
_isRegistered = [self storedLocalNumber] != nil; _isRegistered = [self storedLocalNumber] != nil;
} }
}
return _isRegistered; return _isRegistered;
} }
}
- (void)didRegister - (void)didRegister
{ {

Loading…
Cancel
Save