From 1a2fa1070841845db4c8f057463916284c69420b Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 1 Apr 2024 11:02:33 -0400 Subject: [PATCH] Improve edit list account removal animation --- .../Screens/Lists/EditListAccountsViewController.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Lists/EditListAccountsViewController.swift b/Tusker/Screens/Lists/EditListAccountsViewController.swift index 1760f4ca..f502b4b2 100644 --- a/Tusker/Screens/Lists/EditListAccountsViewController.swift +++ b/Tusker/Screens/Lists/EditListAccountsViewController.swift @@ -298,7 +298,15 @@ class EditListAccountsViewController: UIViewController, CollectionViewController do { let request = List.remove(list.id, accounts: [id]) _ = try await mastodonController.run(request) - await self.loadAccounts() + + var snapshot = dataSource.snapshot() + if snapshot.itemIdentifiers.contains(.account(id: id)) { + snapshot.deleteItems([.account(id: id)]) + await MainActor.run { + dataSource.apply(snapshot) + } + } + } catch { let config = ToastConfiguration(from: error, with: "Error Removing Account", in: self) { [unowned self] toast in toast.dismissToast(animated: true)