From c47480614ceda7b35cafe0f10fde523d45074542 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 12 Apr 2021 21:09:34 -0500 Subject: [PATCH] Fix regression where marking all as unread wouldn't take you back to the sidebar --- Account/Sources/Account/CloudKit/CloudKitAccountDelegate.swift | 3 ++- .../Account/FeedWrangler/FeedWranglerAccountDelegate.swift | 3 ++- Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift | 3 ++- Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift | 3 ++- Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift | 3 ++- .../Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift | 3 ++- iOS/SceneCoordinator.swift | 1 + 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Account/Sources/Account/CloudKit/CloudKitAccountDelegate.swift b/Account/Sources/Account/CloudKit/CloudKitAccountDelegate.swift index 76c10fd5f..00d263530 100644 --- a/Account/Sources/Account/CloudKit/CloudKitAccountDelegate.swift +++ b/Account/Sources/Account/CloudKit/CloudKitAccountDelegate.swift @@ -398,8 +398,9 @@ final class CloudKitAccountDelegate: AccountDelegate { self.database.insertStatuses(syncStatuses) { _ in self.database.selectPendingCount { result in if let count = try? result.get(), count > 100 { - self.sendArticleStatus(for: account, showProgress: false, completion: completion) + self.sendArticleStatus(for: account, showProgress: false) { _ in } } + completion(.success(())) } } case .failure(let error): diff --git a/Account/Sources/Account/FeedWrangler/FeedWranglerAccountDelegate.swift b/Account/Sources/Account/FeedWrangler/FeedWranglerAccountDelegate.swift index 4439e766f..427fc34dc 100644 --- a/Account/Sources/Account/FeedWrangler/FeedWranglerAccountDelegate.swift +++ b/Account/Sources/Account/FeedWrangler/FeedWranglerAccountDelegate.swift @@ -465,8 +465,9 @@ final class FeedWranglerAccountDelegate: AccountDelegate { self.database.insertStatuses(syncStatuses) { _ in self.database.selectPendingCount { result in if let count = try? result.get(), count > 100 { - self.sendArticleStatus(for: account, completion: completion) + self.sendArticleStatus(for: account) { _ in } } + completion(.success(())) } } case .failure(let error): diff --git a/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift b/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift index 16cb36695..d1ba5ee20 100644 --- a/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift +++ b/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift @@ -547,8 +547,9 @@ final class FeedbinAccountDelegate: AccountDelegate { self.database.insertStatuses(syncStatuses) { _ in self.database.selectPendingCount { result in if let count = try? result.get(), count > 100 { - self.sendArticleStatus(for: account, completion: completion) + self.sendArticleStatus(for: account) { _ in } } + completion(.success(())) } } case .failure(let error): diff --git a/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift b/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift index 50fb22594..78526abc9 100644 --- a/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift +++ b/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift @@ -498,8 +498,9 @@ final class FeedlyAccountDelegate: AccountDelegate { self.database.insertStatuses(syncStatuses) { _ in self.database.selectPendingCount { result in if let count = try? result.get(), count > 100 { - self.sendArticleStatus(for: account, completion: completion) + self.sendArticleStatus(for: account) { _ in } } + completion(.success(())) } } case .failure(let error): diff --git a/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift b/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift index 68082ff0e..735ee1a35 100644 --- a/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift +++ b/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift @@ -575,8 +575,9 @@ final class NewsBlurAccountDelegate: AccountDelegate { self.database.insertStatuses(syncStatuses) { _ in self.database.selectPendingCount { result in if let count = try? result.get(), count > 100 { - self.sendArticleStatus(for: account, completion: completion) + self.sendArticleStatus(for: account) { _ in } } + completion(.success(())) } } case .failure(let error): diff --git a/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift b/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift index a6ec6791b..c143a426f 100644 --- a/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift +++ b/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift @@ -540,8 +540,9 @@ final class ReaderAPIAccountDelegate: AccountDelegate { self.database.insertStatuses(syncStatuses) { _ in self.database.selectPendingCount { result in if let count = try? result.get(), count > 100 { - self.sendArticleStatus(for: account, completion: completion) + self.sendArticleStatus(for: account) { _ in } } + completion(.success(())) } } case .failure(let error): diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 02346c5f7..87d9ba4d1 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -1377,6 +1377,7 @@ private extension SceneCoordinator { func markArticlesWithUndo(_ articles: [Article], statusKey: ArticleStatus.Key, flag: Bool, completion: (() -> Void)? = nil) { guard let undoManager = undoManager, let markReadCommand = MarkStatusCommand(initialArticles: articles, statusKey: statusKey, flag: flag, undoManager: undoManager, completion: completion) else { + completion?() return } runCommand(markReadCommand)