restrict more syncing on iPad
This commit is contained in:
parent
1f0a822335
commit
5701a4eab0
@ -292,10 +292,13 @@ NSString *const kSyncManagerLastContactSyncKey = @"kTSStorageManagerOWSSyncManag
|
||||
skipIfRedundant:(BOOL)skipIfRedundant
|
||||
debounce:(BOOL)debounce
|
||||
{
|
||||
if (!self.tsAccountManager.isRegisteredPrimaryDevice) {
|
||||
return [AnyPromise promiseWithValue:OWSErrorMakeAssertionError(@"should not sync from secondary device")];
|
||||
}
|
||||
|
||||
AnyPromise *promise = [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) {
|
||||
[AppReadiness runNowOrWhenAppDidBecomeReady:^{
|
||||
dispatch_async(self.serialQueue, ^{
|
||||
OWSAssertDebug(self.tsAccountManager.isRegisteredPrimaryDevice);
|
||||
if (debounce && self.isRequestInFlight) {
|
||||
// De-bounce. It's okay if we ignore some new changes;
|
||||
// `sendSyncContactsMessageIfPossible` is called fairly
|
||||
|
||||
@ -320,7 +320,8 @@ NSUInteger const kUserProfileSchemaVersion = 1;
|
||||
// We populate an initial (empty) profile on launch of a new install, but
|
||||
// until we have a registered account, syncing will fail (and there could not
|
||||
// be any linked device to sync to at this point anyway).
|
||||
if ([self.tsAccountManager isRegistered] && CurrentAppContext().isMainApp) {
|
||||
if (self.tsAccountManager.isRegisteredPrimaryDevice
|
||||
&& CurrentAppContext().isMainApp) {
|
||||
[[self.syncManager syncLocalContact] retainUntilComplete];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user