From b527fafd370f15e2388b5f49dc325fcbc84e608d Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Sun, 22 Jan 2023 17:49:47 +0100 Subject: [PATCH] Few fixes for the field in DM + fix async upload for images --- .../Conversations/Detail/ConversationDetailView.swift | 5 +++-- .../Status/Sources/Status/Editor/StatusEditorViewModel.swift | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Packages/Conversations/Sources/Conversations/Detail/ConversationDetailView.swift b/Packages/Conversations/Sources/Conversations/Detail/ConversationDetailView.swift index a2b7e548..887be134 100644 --- a/Packages/Conversations/Sources/Conversations/Detail/ConversationDetailView.swift +++ b/Packages/Conversations/Sources/Conversations/Detail/ConversationDetailView.swift @@ -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) } } diff --git a/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift b/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift index 98623f43..5ae797c7 100644 --- a/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift +++ b/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift @@ -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())