Change how initial refresh is triggered.

This commit is contained in:
Maurice Parker 2020-04-01 16:45:29 -05:00
parent b3cf7ccdb7
commit def48546a3
3 changed files with 7 additions and 4 deletions

View File

@ -421,6 +421,11 @@ final class CloudKitAccountDelegate: AccountDelegate {
switch result {
case .success(let externalID):
account.externalID = externalID
self.refreshAll(for: account) { result in
if case .failure(let error) = result {
os_log(.error, log: self.log, "Error while doing intial refresh: %@", error.localizedDescription)
}
}
case .failure(let error):
os_log(.error, log: self.log, "Error adding account container: %@", error.localizedDescription)
}

View File

@ -35,8 +35,7 @@ class AccountsAddCloudKitWindowController: NSWindowController {
}
@IBAction func create(_ sender: Any) {
let account = AccountManager.shared.createAccount(type: .cloudKit)
account.refreshAll(completion: { _ in })
let _ = AccountManager.shared.createAccount(type: .cloudKit)
hostWindow!.endSheet(window!, returnCode: NSApplication.ModalResponse.OK)
}

View File

@ -25,8 +25,7 @@ class CloudKitAccountViewController: UITableViewController {
}
@IBAction func add(_ sender: Any) {
let account = AccountManager.shared.createAccount(type: .cloudKit)
account.refreshAll(completion: { _ in })
let _ = AccountManager.shared.createAccount(type: .cloudKit)
dismiss(animated: true, completion: nil)
delegate?.dismiss()
}