From 70d71c22ae721c5b8d54bc719f0c04f3ef2f3f92 Mon Sep 17 00:00:00 2001 From: dab246 Date: Fri, 1 Mar 2024 00:41:09 +0700 Subject: [PATCH] TF-2644 Display warning dialog when drag & drop file exceeded maximum size in composer Signed-off-by: dab246 --- .../presentation/composer_controller.dart | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/features/composer/presentation/composer_controller.dart b/lib/features/composer/presentation/composer_controller.dart index 0f3feb2c7..1b33f4ca9 100644 --- a/lib/features/composer/presentation/composer_controller.dart +++ b/lib/features/composer/presentation/composer_controller.dart @@ -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() {