From 4e2e4ef34876ea4811ee06b82ab51907de156f23 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 26 Apr 2020 06:23:40 -0500 Subject: [PATCH] Don't try to sync article statuses if a sync is already in progress. --- .../Account/CloudKit/CloudKitAccountDelegate.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift index 783240940..e537351c3 100644 --- a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift +++ b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift @@ -97,6 +97,11 @@ final class CloudKitAccountDelegate: AccountDelegate { } func sendArticleStatus(for account: Account, completion: @escaping ((Result) -> Void)) { + guard refreshProgress.isComplete else { + completion(.success(())) + return + } + os_log(.debug, log: log, "Sending article statuses...") database.selectForProcessing { result in @@ -149,6 +154,11 @@ final class CloudKitAccountDelegate: AccountDelegate { func refreshArticleStatus(for account: Account, completion: @escaping ((Result) -> Void)) { + guard refreshProgress.isComplete else { + completion(.success(())) + return + } + os_log(.debug, log: log, "Refreshing article statuses...") articlesZone.refreshArticles() { result in