Merge branch 'charlesmchen/notMigratedWarning'

pull/1/head
Matthew Chen 7 years ago
commit 9341935700

@ -1000,8 +1000,6 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
DDLogInfo(@"%@ checkIfAppIsReady", self.logTag);
[OWSPreferences setIsRegistered:[TSAccountManager isRegistered]];
// TODO: Once "app ready" logic is moved into AppSetup, move this line there.
[[OWSProfileManager sharedManager] ensureLocalProfileCached];
@ -1061,8 +1059,6 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
DDLogInfo(@"registrationStateDidChange");
[OWSPreferences setIsRegistered:[TSAccountManager isRegistered]];
if ([TSAccountManager isRegistered]) {
DDLogInfo(@"localNumber: %@", [TSAccountManager localNumber]);

@ -30,12 +30,6 @@ extern NSString *const OWSPreferencesKeyEnableDebugLog;
+ (BOOL)isReadyForAppExtensions;
+ (void)setIsReadyForAppExtensions;
// TSAccountManager is the source of truth; this is less reliable
// and should only be used in edge cases where the database is not
// yet available.
+ (BOOL)isRegistered;
+ (void)setIsRegistered:(BOOL)value;
- (BOOL)getHasSentAMessage;
- (void)setHasSentAMessage:(BOOL)enabled;

@ -26,7 +26,6 @@ NSString *const OWSPreferencesKeyCallsHideIPAddress = @"CallsHideIPAddress";
NSString *const OWSPreferencesKeyHasDeclinedNoContactsView = @"hasDeclinedNoContactsView";
NSString *const OWSPreferencesKeyIOSUpgradeNagDate = @"iOSUpgradeNagDate";
NSString *const OWSPreferencesKey_IsReadyForAppExtensions = @"isReadyForAppExtensions_5";
NSString *const OWSPreferencesKey_IsRegistered = @"OWSPreferencesKey_IsRegistered";
@implementation OWSPreferences
@ -85,25 +84,6 @@ NSString *const OWSPreferencesKey_IsRegistered = @"OWSPreferencesKey_IsRegistere
[NSUserDefaults.appUserDefaults synchronize];
}
+ (BOOL)isRegistered
{
NSNumber *preference = [NSUserDefaults.appUserDefaults objectForKey:OWSPreferencesKey_IsRegistered];
if (preference) {
return [preference boolValue];
} else {
return NO;
}
}
+ (void)setIsRegistered:(BOOL)value
{
OWSAssert(CurrentAppContext().isMainApp);
[NSUserDefaults.appUserDefaults setObject:@(value) forKey:OWSPreferencesKey_IsRegistered];
[NSUserDefaults.appUserDefaults synchronize];
}
- (BOOL)screenSecurityIsEnabled
{
NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyScreenSecurity];

@ -66,14 +66,7 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
// abort.
isReadyForAppExtensions = OWSPreferences.isReadyForAppExtensions()
guard isReadyForAppExtensions else {
// If we don't have TSSStorageManager, we can't consult TSAccountManager
// for isRegistered, so we use OWSPreferences which is usually-accurate
// copy of that state.
if OWSPreferences.isRegistered() {
showNotReadyView()
} else {
showNotRegisteredView()
}
showNotReadyView()
return
}

Loading…
Cancel
Save