From 9471d5454f304d258b43cd7407135e056cb4d8ef Mon Sep 17 00:00:00 2001 From: dab246 Date: Fri, 5 May 2023 18:33:58 +0700 Subject: [PATCH] TF-1798 Fix error message is displayed behind the keyboard on IOS platform only (cherry picked from commit 615ff21ce96440cb1da47720116efacb5328cc13) --- .../presentation/composer_controller.dart | 6 +++ .../domain/state/attachment_upload_state.dart | 4 +- lib/l10n/intl_messages.arb | 38 ++++++++++++++++++- lib/main/localizations/app_localizations.dart | 6 +++ 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/lib/features/composer/presentation/composer_controller.dart b/lib/features/composer/presentation/composer_controller.dart index 8aa3d282d..f8c2f6f9d 100644 --- a/lib/features/composer/presentation/composer_controller.dart +++ b/lib/features/composer/presentation/composer_controller.dart @@ -1457,6 +1457,8 @@ class ComposerController extends BaseController { } void insertImage(BuildContext context, double maxWith) async { + clearFocusEditor(context); + if (_responsiveUtils.isMobile(context)) { maxWithEditor = maxWith - 40; } else { @@ -1470,6 +1472,10 @@ class ComposerController extends BaseController { } else { _insertImageOnMobileAndTablet(inlineImage); } + } else { + if (context.mounted) { + _appToast.showToastErrorMessage(context, AppLocalizations.of(context).cannotSelectThisImage); + } } } diff --git a/lib/features/upload/domain/state/attachment_upload_state.dart b/lib/features/upload/domain/state/attachment_upload_state.dart index c4794f6ab..5880651d8 100644 --- a/lib/features/upload/domain/state/attachment_upload_state.dart +++ b/lib/features/upload/domain/state/attachment_upload_state.dart @@ -13,7 +13,7 @@ class PendingAttachmentUploadState extends Success { PendingAttachmentUploadState(this.uploadId, this.progress, this.total); @override - List get props => [progress, total]; + List get props => [uploadId, progress, total]; } class UploadingAttachmentUploadState extends Success { @@ -24,7 +24,7 @@ class UploadingAttachmentUploadState extends Success { UploadingAttachmentUploadState(this.uploadId, this.progress, this.total); @override - List get props => [progress, total]; + List get props => [uploadId, progress, total]; } class SuccessAttachmentUploadState extends Success { diff --git a/lib/l10n/intl_messages.arb b/lib/l10n/intl_messages.arb index 67c34bc47..7c2f23b69 100644 --- a/lib/l10n/intl_messages.arb +++ b/lib/l10n/intl_messages.arb @@ -1,5 +1,5 @@ { - "@@last_modified": "2023-04-12T12:10:00.382074", + "@@last_modified": "2023-05-05T18:33:11.589556", "initializing_data": "Initializing data...", "@initializing_data": { "type": "text", @@ -2757,5 +2757,41 @@ "type": "text", "placeholders_order": [], "placeholders": {} + }, + "forwardedMessage": "Forwarded message", + "@forwardedMessage": { + "type": "text", + "placeholders_order": [], + "placeholders": {} + }, + "repliedMessage": "Replied message", + "@repliedMessage": { + "type": "text", + "placeholders_order": [], + "placeholders": {} + }, + "repliedAndForwardedMessage": "Replied and Forwarded message", + "@repliedAndForwardedMessage": { + "type": "text", + "placeholders_order": [], + "placeholders": {} + }, + "emptyTrash": "Empty Trash", + "@emptyTrash": { + "type": "text", + "placeholders_order": [], + "placeholders": {} + }, + "emptyTrashMessageDialog": "You are about to permanently delete all items in Trash . Do you want to continue?", + "@emptyTrashMessageDialog": { + "type": "text", + "placeholders_order": [], + "placeholders": {} + }, + "cannotSelectThisImage": "Cannot select this image.", + "@cannotSelectThisImage": { + "type": "text", + "placeholders_order": [], + "placeholders": {} } } \ No newline at end of file diff --git a/lib/main/localizations/app_localizations.dart b/lib/main/localizations/app_localizations.dart index 6a0785862..b7b4d9123 100644 --- a/lib/main/localizations/app_localizations.dart +++ b/lib/main/localizations/app_localizations.dart @@ -2863,4 +2863,10 @@ class AppLocalizations { 'You are about to permanently delete all items in Trash . Do you want to continue?', name: 'emptyTrashMessageDialog'); } + + String get cannotSelectThisImage { + return Intl.message( + 'Cannot select this image.', + name: 'cannotSelectThisImage'); + } } \ No newline at end of file