Few fixes for the field in DM + fix async upload for images

This commit is contained in:
Thomas Ricouard 2023-01-22 17:49:47 +01:00
parent a20d259bb2
commit b527fafd37
2 changed files with 6 additions and 2 deletions

View file

@ -115,11 +115,12 @@ public struct ConversationDetailView: View {
} label: {
Image(systemName: "plus")
}
.padding(.bottom, 5)
.padding(.bottom, 6)
TextField("New messge", text: $viewModel.newMessageText, axis: .vertical)
.textFieldStyle(.roundedBorder)
.focused($isMessageFieldFocused)
.keyboardType(.default)
.font(.scaledBody)
if !viewModel.newMessageText.isEmpty {
Button {
Task {
@ -132,7 +133,7 @@ public struct ConversationDetailView: View {
Image(systemName: "paperplane")
}
}
.keyboardShortcut("n", modifiers: .command)
.keyboardShortcut(.return, modifiers: .command)
.padding(.bottom, 5)
}
}

View file

@ -482,6 +482,9 @@ public class StatusEditorViewModel: ObservableObject {
movieTransferable: nil,
mediaAttachment: uploadedMedia,
error: nil)
if let uploadedMedia, uploadedMedia.url == nil {
scheduleAsyncMediaRefresh(mediaAttachement: uploadedMedia)
}
} else if let videoURL = originalContainer.movieTransferable?.url,
let data = try? Data(contentsOf: videoURL) {
let uploadedMedia = try await uploadMedia(data: data, mimeType: videoURL.mimeType())