From 1b22abbbfc00acdeec8b24712329cb0fe2591cfb Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 12 May 2019 19:31:29 -0500 Subject: [PATCH] Make sure a refresh happens after an OPML import. --- Frameworks/Account/Account.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index 4de5babd4..c37a30b93 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -291,7 +291,17 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, } public func importOPML(_ opmlFile: URL, completion: @escaping (Result) -> Void) { - delegate.importOPML(for: self, opmlFile: opmlFile, completion: completion) + delegate.importOPML(for: self, opmlFile: opmlFile) { [weak self] result in + switch result { + case .success: + guard let self = self else { return } + self.delegate.refreshAll(for: self) { + completion(.success(())) + } + case .failure(let error): + completion(.failure(error)) + } + } } public func markArticles(_ articles: Set
, statusKey: ArticleStatus.Key, flag: Bool) -> Set
? {