From 5b6546b761568e1b5a1a6092550ab7e68bc80647 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Fri, 15 Mar 2024 19:50:17 +0000 Subject: [PATCH] fix: allow retrying sending files --- README.md | 2 ++ src/components/common/messaging/MessageBox.tsx | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d79213a0..1261a634 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ PRs for small fixes are more than welcome. ## Deploying a new release +Ensure `.env.local` points to `https://app.revolt.chat/api`. + ```bash cd ~/deployments/revite git pull diff --git a/src/components/common/messaging/MessageBox.tsx b/src/components/common/messaging/MessageBox.tsx index 69b425be..78c26981 100644 --- a/src/components/common/messaging/MessageBox.tsx +++ b/src/components/common/messaging/MessageBox.tsx @@ -324,7 +324,7 @@ export default observer(({ channel }: Props) => { return; const content = state.draft.get(channel._id)?.content?.trim() ?? ""; - if (uploadState.type === "attached") return sendFile(content); + if (uploadState.type !== "none") return sendFile(content); if (content.length === 0) return; internalEmit("NewMessages", "hide"); @@ -406,7 +406,9 @@ export default observer(({ channel }: Props) => { * @returns */ async function sendFile(content: string) { - if (uploadState.type !== "attached") return; + if (uploadState.type !== "attached" && uploadState.type !== "failed") + return; + const attachments: string[] = []; setMessage;