Fix editor progress bar

This commit is contained in:
Thomas Ricouard 2024-05-04 11:27:52 +02:00
parent e857439a02
commit 66754ecc7c

View file

@ -41,11 +41,9 @@ public extension StatusEditor {
@Bindable var focusedSEVM = focusedSEVM
NavigationStack {
ZStack(alignment: .top) {
ScrollView {
VStackLayout(spacing: 0) {
if mainSEVM.isPosting {
ProgressView(value: mainSEVM.postingProgress, total: 100.0)
}
EditorView(
viewModel: mainSEVM,
followUpSEVMs: $followUpSEVMs,
@ -75,25 +73,25 @@ public extension StatusEditor {
.scrollPosition(id: $scrollID, anchor: .top)
.animation(.bouncy(duration: 0.3), value: editorFocusState)
.animation(.bouncy(duration: 0.3), value: followUpSEVMs)
#if !os(visionOS)
#if !os(visionOS)
.background(theme.primaryBackgroundColor)
#endif
#endif
.safeAreaInset(edge: .bottom) {
AutoCompleteView(viewModel: focusedSEVM)
}
#if os(visionOS)
#if os(visionOS)
.ornament(attachmentAnchor: .scene(.leading)) {
AccessoryView(focusedSEVM: focusedSEVM,
followUpSEVMs: $followUpSEVMs)
}
#else
#else
.safeAreaInset(edge: .bottom) {
if presentationDetent == .large || presentationDetent == .medium {
AccessoryView(focusedSEVM: focusedSEVM,
followUpSEVMs: $followUpSEVMs)
}
}
#endif
#endif
.accessibilitySortPriority(1) // Ensure that all elements inside the `ScrollView` occur earlier than the accessory views
.navigationTitle(focusedSEVM.mode.title)
.navigationBarTitleDisplayMode(.inline)
@ -143,6 +141,10 @@ public extension StatusEditor {
}
}
}
if mainSEVM.isPosting {
ProgressView(value: mainSEVM.postingProgress, total: 100.0)
}
}
}
.sheet(item: $editingMediaContainer) { container in
StatusEditor.MediaEditView(viewModel: focusedSEVM, container: container)