diff --git a/Tusker/Screens/Lists/EditListAccountsViewController.swift b/Tusker/Screens/Lists/EditListAccountsViewController.swift index f502b4b2..b3a8ed0c 100644 --- a/Tusker/Screens/Lists/EditListAccountsViewController.swift +++ b/Tusker/Screens/Lists/EditListAccountsViewController.swift @@ -17,7 +17,7 @@ class EditListAccountsViewController: UIViewController, CollectionViewController private var state = State.unloaded - private(set) var changedAccounts = false + private(set) var shouldReloadListTimeline = false private var dataSource: UICollectionViewDiffableDataSource! var collectionView: UICollectionView! { view as? UICollectionView } @@ -278,7 +278,7 @@ class EditListAccountsViewController: UIViewController, CollectionViewController } private func addAccount(id: String) async { - changedAccounts = true + shouldReloadListTimeline = true do { let req = List.add(list.id, accounts: [id]) _ = try await mastodonController.run(req) @@ -294,7 +294,7 @@ class EditListAccountsViewController: UIViewController, CollectionViewController } private func removeAccount(id: String) async { - changedAccounts = true + shouldReloadListTimeline = true do { let request = List.remove(list.id, accounts: [id]) _ = try await mastodonController.run(request) @@ -317,6 +317,7 @@ class EditListAccountsViewController: UIViewController, CollectionViewController } private func setReplyPolicy(_ replyPolicy: List.ReplyPolicy) { + shouldReloadListTimeline = true Task { let service = EditListSettingsService(list: list, mastodonController: mastodonController, present: { self.present($0, animated: true) }) await service.run(replyPolicy: replyPolicy) diff --git a/Tusker/Screens/Lists/ListTimelineViewController.swift b/Tusker/Screens/Lists/ListTimelineViewController.swift index a0db57b7..678f2fc6 100644 --- a/Tusker/Screens/Lists/ListTimelineViewController.swift +++ b/Tusker/Screens/Lists/ListTimelineViewController.swift @@ -101,7 +101,7 @@ class ListTimelineViewController: TimelineViewController { } private func reloadIfNecessary(editViewController: EditListAccountsViewController) { - guard editViewController.changedAccounts else { + guard editViewController.shouldReloadListTimeline else { return } noContentView?.removeFromSuperview()