fix(compose): wait for in-flight attachment uploads before sending
Clicking Send while attachments were still uploading silently dropped them from the outgoing message: every place that builds the outgoing attachment list filters on att.blobId && !att.uploading, and the Send button never accounted for uploads still in flight. Attach a few files, hit Send right away, and the email could go out missing some of them with no warning. handleSend now detects pending uploads before validating: - Send is disabled with an explanatory tooltip (validation.attachments_uploading) while it waits. - Once uploads finish cleanly, the send proceeds automatically - no second click needed. - If an upload FAILS while waiting, the send is aborted with an error toast (validation.attachment_upload_failed) instead of silently shipping the email without the failed attachment - the user may not be looking at the composer to notice the red error chip. - If the draft is closed or discarded while waiting, the pending send is cancelled cleanly. The wait/decision logic lives in waitForPendingUploads() in lib/email-composer-utils.ts (returns completed | cancelled | failed) with unit tests covering all three outcomes. Outgoing-attachment call sites read the freshest state via attachmentsRef since the render closure captured at click time won't reflect uploads that finished during the wait. Both new i18n keys added to all 20 locales under email_composer.validation.
This commit is contained in:
@@ -632,7 +632,9 @@
|
||||
"validation": {
|
||||
"recipient_required": "보내려면 받는 사람을 추가해 주세요",
|
||||
"subject_required": "제목을 입력해 주세요",
|
||||
"body_required": "메시지를 작성하거나 파일을 첨부해 주세요"
|
||||
"body_required": "메시지를 작성하거나 파일을 첨부해 주세요",
|
||||
"attachments_uploading": "첨부 파일을 업로드하는 중입니다. 완료되면 자동으로 전송됩니다",
|
||||
"attachment_upload_failed": "전송되지 않았습니다. 첨부 파일 업로드에 실패했습니다. 해당 파일을 제거하고 다시 시도하세요."
|
||||
},
|
||||
"upload_progress": "{uploaded} / {total} 업로드 중",
|
||||
"upload_cancel": "업로드 취소",
|
||||
|
||||
Reference in New Issue
Block a user