From e7c339fb093deb328f94e0d45e55e6ee7a3674f2 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 30 May 2019 17:41:56 -0500 Subject: [PATCH] Update iOS to work with the latest Account API --- iOS/MasterFeed/MasterFeedViewController.swift | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index 73a654501..4f01ed04d 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -373,22 +373,17 @@ class MasterFeedViewController: ProgressTableViewController, UndoableCommandRunn }() // Move the Feed - let source = sourceNode.parent?.representedObject as? Container - let destination = destParentNode?.representedObject as? Container - source?.removeFeed(feed) { [weak self] result in + guard let source = sourceNode.parent?.representedObject as? Container, let destination = destParentNode?.representedObject as? Container else { + return + } + + BatchUpdate.shared.start() + source.account?.moveFeed(feed, from: source, to: destination) { result in switch result { case .success: - destination?.addFeed(feed) { result in - switch result { - case .success: - break - case .failure(let error): - source?.addFeed(feed) { result in } - self?.presentError(error) - } - } + BatchUpdate.shared.end() case .failure(let error): - self?.presentError(error) + self.presentError(error) } }