diff --git a/src/app/features/room/RoomInput.tsx b/src/app/features/room/RoomInput.tsx index 6f9a249..d874ebb 100644 --- a/src/app/features/room/RoomInput.tsx +++ b/src/app/features/room/RoomInput.tsx @@ -237,10 +237,12 @@ export const RoomInput = forwardRef( }); handleCancelUpload(uploads); const contents = fulfilledPromiseSettledResult(await Promise.allSettled(contentsPromises)); - contents.forEach((content) => mx.sendMessage(roomId, content)); + for (const content of contents) { + await mx.sendMessage(roomId, content); + } }; - const submit = useCallback(() => { + const submit = useCallback(async () => { uploadBoardHandlers.current?.handleSend(); const commandName = getBeginCommand(editor); @@ -309,7 +311,7 @@ export const RoomInput = forwardRef( }, }; } - mx.sendMessage(roomId, content); + await mx.sendMessage(roomId, content); resetEditor(editor); resetEditorHistory(editor); setReplyDraft(undefined);