TF-2644 Display warning dialog when drag & drop file exceeded maximum size in composer

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2024-03-01 00:41:09 +07:00
committed by Dat H. Pham
parent 4350a2bd3a
commit 70d71c22ae
@@ -1978,20 +1978,10 @@ class ComposerController extends BaseController {
} }
void _addAttachmentFromDragAndDrop({required FileInfo fileInfo}) { void _addAttachmentFromDragAndDrop({required FileInfo fileInfo}) {
if (!uploadController.isExceededMaxSizeAttachmentsPerEmail(totalSizePreparedFiles: fileInfo.fileSize)) { uploadController.validateTotalSizeAttachmentsBeforeUpload(
_uploadAttachmentsAction([fileInfo]); listFileInfo: [fileInfo],
} else { callbackAction: () => _uploadAttachmentsAction([fileInfo])
if (currentContext != null) { );
showConfirmDialogAction(
currentContext!,
AppLocalizations.of(currentContext!).message_dialog_upload_attachments_exceeds_maximum_size(
filesize(mailboxDashBoardController.maxSizeAttachmentsPerEmail?.value ?? 0, 0)),
AppLocalizations.of(currentContext!).got_it,
title: AppLocalizations.of(currentContext!).maximum_files_size,
hasCancelButton: false,
);
}
}
} }
FocusNode? getNextFocusOfToEmailAddress() { FocusNode? getNextFocusOfToEmailAddress() {