Skip to content

Commit

Permalink
fix: allow retrying sending files
Browse files Browse the repository at this point in the history
  • Loading branch information
insertish committed Mar 15, 2024
1 parent c25ecc1 commit 5b6546b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/components/common/messaging/MessageBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 5b6546b

Please sign in to comment.