From 3394c2126c8dd7e3250f4ecb7fb7e221b0283744 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 10 May 2023 11:11:48 -0400 Subject: [PATCH] Fix list timelines opened in new window not showing Edit button --- Tusker/Scenes/AuxiliarySceneDelegate.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tusker/Scenes/AuxiliarySceneDelegate.swift b/Tusker/Scenes/AuxiliarySceneDelegate.swift index 7480865f..507c1586 100644 --- a/Tusker/Scenes/AuxiliarySceneDelegate.swift +++ b/Tusker/Scenes/AuxiliarySceneDelegate.swift @@ -106,7 +106,15 @@ class AuxiliarySceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDel private func timelineViewController(for timeline: Timeline, mastodonController: MastodonController) -> UIViewController { switch timeline { - // todo: list/hashtag controllers need whole objects which must be fetched asynchronously + // todo: hashtag controllers need whole objects which must be fetched asynchronously, and that endpoint only exists in mastodon v4 + case .list(id: let id): + let req = ListMO.fetchRequest(id: id) + if let list = try? mastodonController.persistentContainer.viewContext.fetch(req).first { + return ListTimelineViewController(for: List(id: id, title: list.title), mastodonController: mastodonController) + } else { + return TimelineViewController(for: timeline, mastodonController: mastodonController) + } + default: return TimelineViewController(for: timeline, mastodonController: mastodonController) }