fix: allow retrying sending files

This commit is contained in:
Paul Makles 2024-03-15 19:50:17 +00:00
parent c25ecc12b2
commit 5b6546b761
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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;