Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent 0a4f004935
commit e8ddc041dd

@ -237,14 +237,14 @@ NSString *const kOWSBackup_ImportDatabaseKeySpec = @"kOWSBackup_ImportDatabaseKe
progress:@(progress)]; progress:@(progress)];
}) })
.thenInBackground(^{ .thenInBackground(^{
return [self downloadFileFromCloud:item ignoreErrors:NO]; return [self downloadFileFromCloud:item];
}); });
} }
return promise; return promise;
} }
- (AnyPromise *)downloadFileFromCloud:(OWSBackupFragment *)item ignoreErrors:(BOOL)ignoreErrors - (AnyPromise *)downloadFileFromCloud:(OWSBackupFragment *)item
{ {
OWSAssertDebug(item); OWSAssertDebug(item);
@ -280,11 +280,7 @@ NSString *const kOWSBackup_ImportDatabaseKeySpec = @"kOWSBackup_ImportDatabaseKe
resolve(@(1)); resolve(@(1));
}) })
.catchInBackground(^(NSError *error) { .catchInBackground(^(NSError *error) {
if (ignoreErrors) { resolve(error);
resolve(@(1));
} else {
resolve(error);
}
}); });
}]; }];
} }
@ -302,7 +298,10 @@ NSString *const kOWSBackup_ImportDatabaseKeySpec = @"kOWSBackup_ImportDatabaseKe
if (self.manifest.localProfileAvatarItem) { if (self.manifest.localProfileAvatarItem) {
promise = promise.thenInBackground(^{ promise = promise.thenInBackground(^{
return [self downloadFileFromCloud:self.manifest.localProfileAvatarItem ignoreErrors:YES]; return
[self downloadFileFromCloud:self.manifest.localProfileAvatarItem].catchInBackground(^(NSError *error) {
OWSLogInfo(@"Ignoring error; profiles are optional: %@", error);
});
}); });
} }

@ -62,15 +62,6 @@ public class BackupLazyRestore: NSObject {
runIfNecessary() runIfNecessary()
} }
@objc
public func clearCompleteAndRunIfNecessary() {
AssertIsOnMainThread()
isComplete = false
runIfNecessary()
}
@objc @objc
public func runIfNecessary() { public func runIfNecessary() {
AssertIsOnMainThread() AssertIsOnMainThread()

Loading…
Cancel
Save