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