diff --git a/Tusker/Screens/Compose/ComposeView.swift b/Tusker/Screens/Compose/ComposeView.swift index f9f89ffda1..cceec341d1 100644 --- a/Tusker/Screens/Compose/ComposeView.swift +++ b/Tusker/Screens/Compose/ComposeView.swift @@ -42,9 +42,11 @@ import Combine } struct ComposeView: View { - @ObservedObject var draft: Draft @ObservedObject var mastodonController: MastodonController @ObservedObject var uiState: ComposeUIState + var draft: Draft { + uiState.draft + } @State private var globalFrameOutsideList: CGRect = .zero @State private var contentWarningBecomeFirstResponder = false @@ -54,7 +56,6 @@ struct ComposeView: View { @OptionalStateObject private var poster: PostService? @State private var isShowingPostErrorAlert = false @State private var postError: PostService.Error? - private var isPosting: Bool { poster != nil } @@ -62,7 +63,6 @@ struct ComposeView: View { private let stackPadding: CGFloat = 8 init(mastodonController: MastodonController, uiState: ComposeUIState) { - self.draft = uiState.draft self.mastodonController = mastodonController self.uiState = uiState } @@ -175,7 +175,7 @@ struct ComposeView: View { if draft.contentWarningEnabled { ComposeEmojiTextField( - text: $draft.contentWarning, + text: $uiState.draft.contentWarning, placeholder: "Write your warning here", becomeFirstResponder: $contentWarningBecomeFirstResponder, focusNextView: $mainComposeTextViewBecomeFirstResponder