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}) {
if (!uploadController.isExceededMaxSizeAttachmentsPerEmail(totalSizePreparedFiles: fileInfo.fileSize)) {
_uploadAttachmentsAction([fileInfo]);
} else {
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,
);
}
}
uploadController.validateTotalSizeAttachmentsBeforeUpload(
listFileInfo: [fileInfo],
callbackAction: () => _uploadAttachmentsAction([fileInfo])
);
}
FocusNode? getNextFocusOfToEmailAddress() {