mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 01:15:28 +00:00
fix: allow retrying sending files
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user