forked from shadowfacts/Tusker
Improve edit list account removal animation
This commit is contained in:
parent
f79c2feea6
commit
1a2fa10708
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue