parent
bab5226f2a
commit
dfeb39b31f
|
@ -42,9 +42,11 @@ import Combine
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ComposeView: View {
|
struct ComposeView: View {
|
||||||
@ObservedObject var draft: Draft
|
|
||||||
@ObservedObject var mastodonController: MastodonController
|
@ObservedObject var mastodonController: MastodonController
|
||||||
@ObservedObject var uiState: ComposeUIState
|
@ObservedObject var uiState: ComposeUIState
|
||||||
|
var draft: Draft {
|
||||||
|
uiState.draft
|
||||||
|
}
|
||||||
|
|
||||||
@State private var globalFrameOutsideList: CGRect = .zero
|
@State private var globalFrameOutsideList: CGRect = .zero
|
||||||
@State private var contentWarningBecomeFirstResponder = false
|
@State private var contentWarningBecomeFirstResponder = false
|
||||||
|
@ -54,7 +56,6 @@ struct ComposeView: View {
|
||||||
@OptionalStateObject private var poster: PostService?
|
@OptionalStateObject private var poster: PostService?
|
||||||
@State private var isShowingPostErrorAlert = false
|
@State private var isShowingPostErrorAlert = false
|
||||||
@State private var postError: PostService.Error?
|
@State private var postError: PostService.Error?
|
||||||
|
|
||||||
private var isPosting: Bool {
|
private var isPosting: Bool {
|
||||||
poster != nil
|
poster != nil
|
||||||
}
|
}
|
||||||
|
@ -62,7 +63,6 @@ struct ComposeView: View {
|
||||||
private let stackPadding: CGFloat = 8
|
private let stackPadding: CGFloat = 8
|
||||||
|
|
||||||
init(mastodonController: MastodonController, uiState: ComposeUIState) {
|
init(mastodonController: MastodonController, uiState: ComposeUIState) {
|
||||||
self.draft = uiState.draft
|
|
||||||
self.mastodonController = mastodonController
|
self.mastodonController = mastodonController
|
||||||
self.uiState = uiState
|
self.uiState = uiState
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ struct ComposeView: View {
|
||||||
|
|
||||||
if draft.contentWarningEnabled {
|
if draft.contentWarningEnabled {
|
||||||
ComposeEmojiTextField(
|
ComposeEmojiTextField(
|
||||||
text: $draft.contentWarning,
|
text: $uiState.draft.contentWarning,
|
||||||
placeholder: "Write your warning here",
|
placeholder: "Write your warning here",
|
||||||
becomeFirstResponder: $contentWarningBecomeFirstResponder,
|
becomeFirstResponder: $contentWarningBecomeFirstResponder,
|
||||||
focusNextView: $mainComposeTextViewBecomeFirstResponder
|
focusNextView: $mainComposeTextViewBecomeFirstResponder
|
||||||
|
|
Loading…
Reference in New Issue