mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-05 23:25:44 -05:00
fix: allow retrying sending files
This commit is contained in:
parent
c25ecc12b2
commit
5b6546b761
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue