From 984322453f63db0f6f4a4338656125f54d909efd Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 17 Apr 2020 09:14:27 -0500 Subject: [PATCH] Commented why we use BatchUpdate on RSS feed adds because I keep forgetting why. --- Frameworks/Account/LocalAccount/LocalAccountDelegate.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift b/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift index 41efd18ff..c88fa7685 100644 --- a/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift +++ b/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift @@ -292,9 +292,12 @@ private extension LocalAccountDelegate { } func createRSSWebFeed(for account: Account, url: URL, name: String?, container: Container, completion: @escaping (Result) -> Void) { - - refreshProgress.addToNumberOfTasksAndRemaining(1) + + // We need to use a batch update here because we need to assign add the feed to the + // container before the name has been downloaded. This will put it in the sidebar + // with an Untitled name if we don't delay it being added to the sidebar. BatchUpdate.shared.start() + refreshProgress.addToNumberOfTasksAndRemaining(1) FeedFinder.find(url: url) { result in switch result {