From af5109f86ca99f8aa04468e19fcdfd4dbcc02ae9 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 23 Apr 2023 14:27:10 -0400 Subject: [PATCH] Fix restored, ducked Compose screen lacking title --- .../Controllers/ComposeController.swift | 20 +++++++++---------- .../Compose/ComposeHostingController.swift | 4 +++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Packages/ComposeUI/Sources/ComposeUI/Controllers/ComposeController.swift b/Packages/ComposeUI/Sources/ComposeUI/Controllers/ComposeController.swift index d5b94505..6ce9606d 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Controllers/ComposeController.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Controllers/ComposeController.swift @@ -71,6 +71,15 @@ public final class ComposeController: ViewController { draft.poll == nil || draft.poll!.pollOptions.allSatisfy { !$0.text.isEmpty } } + public var navigationTitle: String { + if let id = draft.inReplyToID, + let status = fetchStatus(id) { + return "Reply to @\(status.account.acct)" + } else { + return "New Post" + } + } + public init( draft: Draft, config: ComposeUIConfig, @@ -281,16 +290,7 @@ public final class ComposeController: ViewController { Text(error.localizedDescription) }) .onDisappear(perform: controller.onDisappear) - .navigationTitle(navTitle) - } - - private var navTitle: String { - if let id = draft.inReplyToID, - let status = controller.fetchStatus(id) { - return "Reply to @\(status.account.acct)" - } else { - return "New Post" - } + .navigationTitle(controller.navigationTitle) } private var mainList: some View { diff --git a/Tusker/Screens/Compose/ComposeHostingController.swift b/Tusker/Screens/Compose/ComposeHostingController.swift index d1d2a281..490e4904 100644 --- a/Tusker/Screens/Compose/ComposeHostingController.swift +++ b/Tusker/Screens/Compose/ComposeHostingController.swift @@ -28,7 +28,6 @@ class ComposeHostingController: UIHostingController Void)? private var drawingCompletion: ((PKDrawing) -> Void)? @@ -56,6 +55,9 @@ class ComposeHostingController: UIHostingController