diff --git a/lib/features/composer/presentation/controller/rich_text_mobile_tablet_controller.dart b/lib/features/composer/presentation/controller/rich_text_mobile_tablet_controller.dart
index ec887b5f1..4f349ba97 100644
--- a/lib/features/composer/presentation/controller/rich_text_mobile_tablet_controller.dart
+++ b/lib/features/composer/presentation/controller/rich_text_mobile_tablet_controller.dart
@@ -14,11 +14,13 @@ class RichTextMobileTabletController extends BaseRichTextController {
final RichTextController richTextController = RichTextController();
void insertImage(InlineImage inlineImage) async {
- if (inlineImage.fileInfo.isShared == true) {
- await htmlEditorApi?.moveCursorAtLastNode();
+ bool isEditorFocused = await htmlEditorApi?.hasFocus() ?? false;
+ log('RichTextMobileTabletController::insertImage: isEditorFocused = $isEditorFocused');
+ if (!isEditorFocused) {
+ await htmlEditorApi?.requestFocusLastChild();
}
if (inlineImage.base64Uri?.isNotEmpty == true) {
- await htmlEditorApi?.insertHtml(inlineImage.base64Uri!);
+ await htmlEditorApi?.insertHtml('${inlineImage.base64Uri ?? ''}
');
}
}
diff --git a/lib/features/upload/presentation/controller/upload_controller.dart b/lib/features/upload/presentation/controller/upload_controller.dart
index b32d4425d..37569703b 100644
--- a/lib/features/upload/presentation/controller/upload_controller.dart
+++ b/lib/features/upload/presentation/controller/upload_controller.dart
@@ -170,9 +170,6 @@ class UploadController extends BaseController {
cid: uuid.v1()
);
- final uploadFileState = _uploadingStateInlineFiles.getUploadFileStateById(success.uploadId);
- log('UploadController::_handleProgressUploadInlineImageStateStream:uploadId: ${uploadFileState?.uploadTaskId} | fromFileShared: ${uploadFileState?.file?.isShared}');
-
_uploadingStateInlineFiles.updateElementByUploadTaskId(
success.uploadId,
(currentState) {
diff --git a/pubspec.lock b/pubspec.lock
index c2272824e..1560c58ca 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -433,11 +433,11 @@ packages:
source: path
version: "1.0.0+1"
enough_html_editor:
- dependency: transitive
+ dependency: "direct overridden"
description:
path: "."
- ref: cnb_supported
- resolved-ref: "6409f47b01c5992906971f2d8fdb8be3278bf787"
+ ref: cherry-pick-add-attachment-app-bar
+ resolved-ref: "195c74a0d65fc95226dbd257a40bc8c0c55f9a3e"
url: "https://github.com/linagora/enough_html_editor.git"
source: git
version: "0.0.5"
diff --git a/pubspec.yaml b/pubspec.yaml
index b3628eb82..8c5a7fc17 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -280,6 +280,11 @@ dependency_overrides:
url: https://github.com/linagora/flutter_file_picker
ref: email_supported_5.3.1
+ enough_html_editor:
+ git:
+ url: https://github.com/linagora/enough_html_editor.git
+ ref: cherry-pick-add-attachment-app-bar
+
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec