Fix selecting draft not working

Closes #263
This commit is contained in:
Shadowfacts 2022-11-22 14:00:41 -05:00
parent bab5226f2a
commit dfeb39b31f
1 changed files with 4 additions and 4 deletions

View File

@ -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