Don't erase alt text on app switch Fix #1419

This commit is contained in:
Thomas Ricouard 2023-07-18 07:20:43 +02:00
parent 4168c64d20
commit 67d1dede04

View file

@ -15,6 +15,8 @@ struct StatusEditorMediaEditView: View {
@FocusState private var isFieldFocused: Bool
@State private var isUpdating: Bool = false
@State private var didAppear: Bool = false
var body: some View {
NavigationStack {
@ -51,8 +53,11 @@ struct StatusEditorMediaEditView: View {
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.onAppear {
imageDescription = container.mediaAttachment?.description ?? ""
isFieldFocused = true
if !didAppear {
imageDescription = container.mediaAttachment?.description ?? ""
isFieldFocused = true
didAppear = true
}
}
.navigationTitle("status.editor.media.edit-image")
.navigationBarTitleDisplayMode(.inline)