TF-2930 Fix not persist hasRequestReadReceipt when reload browser
This commit is contained in:
@@ -219,7 +219,6 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
||||
createFocusNodeInput();
|
||||
scrollControllerEmailAddress.addListener(_scrollControllerEmailAddressListener);
|
||||
_listenStreamEvent();
|
||||
_getAlwaysReadReceiptSetting();
|
||||
_beforeReconnectManager.addListener(onBeforeReconnect);
|
||||
}
|
||||
|
||||
@@ -427,8 +426,7 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
||||
await _saveComposerCacheOnWebInteractor.execute(
|
||||
createEmailRequest,
|
||||
mailboxDashBoardController.accountId.value!,
|
||||
mailboxDashBoardController.sessionCurrent!.username,
|
||||
displayMode: screenDisplayMode.value);
|
||||
mailboxDashBoardController.sessionCurrent!.username);
|
||||
}
|
||||
|
||||
Future<CreateEmailRequest?> _generateCreateEmailRequest() async {
|
||||
@@ -452,7 +450,7 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
||||
toRecipients: listToEmailAddress.toSet(),
|
||||
ccRecipients: listCcEmailAddress.toSet(),
|
||||
bccRecipients: listBccEmailAddress.toSet(),
|
||||
isRequestReadReceipt: hasRequestReadReceipt.value,
|
||||
hasRequestReadReceipt: hasRequestReadReceipt.value,
|
||||
identity: identitySelected.value,
|
||||
attachments: uploadController.attachmentsUploaded,
|
||||
inlineAttachments: uploadController.mapInlineAttachments,
|
||||
@@ -464,7 +462,8 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
||||
unsubscribeEmailId: composerArguments.value!.previousEmailId,
|
||||
messageId: composerArguments.value!.messageId,
|
||||
references: composerArguments.value!.references,
|
||||
emailSendingQueue: composerArguments.value!.sendingEmail
|
||||
emailSendingQueue: composerArguments.value!.sendingEmail,
|
||||
displayMode: screenDisplayMode.value
|
||||
);
|
||||
}
|
||||
|
||||
@@ -668,8 +667,6 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
||||
accountId: accountId,
|
||||
downloadUrl: downloadUrl
|
||||
);
|
||||
|
||||
hasRequestReadReceipt.value = arguments.readRecepientEnabled ?? false;
|
||||
break;
|
||||
case EmailActionType.composeFromUnsubscribeMailtoLink:
|
||||
if (arguments.subject != null) {
|
||||
@@ -687,6 +684,13 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (composerArguments.value?.emailActionType == EmailActionType.reopenComposerBrowser) {
|
||||
log('ComposerController::_initEmail: hasRequestReadReceipt = ${arguments.hasRequestReadReceipt}');
|
||||
hasRequestReadReceipt.value = arguments.hasRequestReadReceipt ?? false;
|
||||
} else {
|
||||
_getAlwaysReadReceiptSetting();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -985,7 +989,7 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
||||
toRecipients: listToEmailAddress.toSet(),
|
||||
ccRecipients: listCcEmailAddress.toSet(),
|
||||
bccRecipients: listBccEmailAddress.toSet(),
|
||||
isRequestReadReceipt: hasRequestReadReceipt.value,
|
||||
hasRequestReadReceipt: hasRequestReadReceipt.value,
|
||||
identity: identitySelected.value,
|
||||
attachments: uploadController.attachmentsUploaded,
|
||||
inlineAttachments: uploadController.mapInlineAttachments,
|
||||
@@ -998,7 +1002,8 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
||||
unsubscribeEmailId: composerArguments.value!.previousEmailId,
|
||||
messageId: composerArguments.value!.messageId,
|
||||
references: composerArguments.value!.references,
|
||||
emailSendingQueue: composerArguments.value!.sendingEmail
|
||||
emailSendingQueue: composerArguments.value!.sendingEmail,
|
||||
displayMode: screenDisplayMode.value
|
||||
),
|
||||
createNewAndSendEmailInteractor: _createNewAndSendEmailInteractor,
|
||||
onCancelSendingEmailAction: _handleCancelSendingMessage,
|
||||
@@ -2104,6 +2109,7 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
||||
}
|
||||
|
||||
void _getAlwaysReadReceiptSetting() {
|
||||
log('ComposerController::_getAlwaysReadReceiptSetting:');
|
||||
final accountId = mailboxDashBoardController.accountId.value;
|
||||
if (accountId != null) {
|
||||
consumeState(_getAlwaysReadReceiptSettingInteractor.execute(accountId));
|
||||
@@ -2220,7 +2226,7 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
||||
toRecipients: listToEmailAddress.toSet(),
|
||||
ccRecipients: listCcEmailAddress.toSet(),
|
||||
bccRecipients: listBccEmailAddress.toSet(),
|
||||
isRequestReadReceipt: hasRequestReadReceipt.value,
|
||||
hasRequestReadReceipt: hasRequestReadReceipt.value,
|
||||
identity: identitySelected.value,
|
||||
attachments: uploadController.attachmentsUploaded,
|
||||
inlineAttachments: uploadController.mapInlineAttachments,
|
||||
@@ -2231,7 +2237,8 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
||||
unsubscribeEmailId: composerArguments.value!.previousEmailId,
|
||||
messageId: composerArguments.value!.messageId,
|
||||
references: composerArguments.value!.references,
|
||||
emailSendingQueue: composerArguments.value!.sendingEmail
|
||||
emailSendingQueue: composerArguments.value!.sendingEmail,
|
||||
displayMode: screenDisplayMode.value
|
||||
),
|
||||
createNewAndSaveEmailToDraftsInteractor: _createNewAndSaveEmailToDraftsInteractor,
|
||||
onCancelSavingEmailToDraftsAction: _handleCancelSavingMessageToDrafts,
|
||||
|
||||
@@ -142,7 +142,7 @@ extension CreateEmailRequestExtension on CreateEmailRequest {
|
||||
attachments: newEmailAttachments.isNotEmpty
|
||||
? newEmailAttachments
|
||||
: null,
|
||||
headerMdn: isRequestReadReceipt
|
||||
headerMdn: hasRequestReadReceipt
|
||||
? { IndividualHeaderIdentifier.headerMdn: createMdnEmailAddress() }
|
||||
: null,
|
||||
);
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
||||
import 'package:model/email/attachment.dart';
|
||||
import 'package:model/email/email_action_type.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/screen_display_mode.dart';
|
||||
import 'package:tmail_ui_user/features/sending_queue/domain/model/sending_email.dart';
|
||||
|
||||
class CreateEmailRequest with EquatableMixin {
|
||||
@@ -17,7 +18,7 @@ class CreateEmailRequest with EquatableMixin {
|
||||
final EmailActionType emailActionType;
|
||||
final String subject;
|
||||
final String emailContent;
|
||||
final bool isRequestReadReceipt;
|
||||
final bool hasRequestReadReceipt;
|
||||
final Set<EmailAddress> fromSender;
|
||||
final Set<EmailAddress> toRecipients;
|
||||
final Set<EmailAddress> ccRecipients;
|
||||
@@ -34,6 +35,7 @@ class CreateEmailRequest with EquatableMixin {
|
||||
final MessageIdsHeaderValue? messageId;
|
||||
final MessageIdsHeaderValue? references;
|
||||
final SendingEmail? emailSendingQueue;
|
||||
final ScreenDisplayMode displayMode;
|
||||
|
||||
CreateEmailRequest({
|
||||
required this.session,
|
||||
@@ -45,7 +47,7 @@ class CreateEmailRequest with EquatableMixin {
|
||||
required this.toRecipients,
|
||||
required this.ccRecipients,
|
||||
required this.bccRecipients,
|
||||
this.isRequestReadReceipt = true,
|
||||
this.hasRequestReadReceipt = true,
|
||||
this.identity,
|
||||
this.attachments,
|
||||
this.inlineAttachments,
|
||||
@@ -57,7 +59,8 @@ class CreateEmailRequest with EquatableMixin {
|
||||
this.unsubscribeEmailId,
|
||||
this.messageId,
|
||||
this.references,
|
||||
this.emailSendingQueue
|
||||
this.emailSendingQueue,
|
||||
this.displayMode = ScreenDisplayMode.normal
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -72,7 +75,7 @@ class CreateEmailRequest with EquatableMixin {
|
||||
ccRecipients,
|
||||
bccRecipients,
|
||||
identity,
|
||||
isRequestReadReceipt,
|
||||
hasRequestReadReceipt,
|
||||
attachments,
|
||||
inlineAttachments,
|
||||
outboxMailboxId,
|
||||
@@ -83,6 +86,7 @@ class CreateEmailRequest with EquatableMixin {
|
||||
unsubscribeEmailId,
|
||||
references,
|
||||
references,
|
||||
emailSendingQueue
|
||||
emailSendingQueue,
|
||||
displayMode,
|
||||
];
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import 'package:dartz/dartz.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:html_editor_enhanced/html_editor.dart';
|
||||
import 'package:model/email/email_action_type.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/state/restore_email_inline_images_state.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/view/editor_view_mixin.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/web/web_editor_widget.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/state/get_email_content_state.dart';
|
||||
@@ -102,7 +103,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
||||
onDragEnter: onDragEnter,
|
||||
),
|
||||
(success) {
|
||||
if (success is GetEmailContentLoading) {
|
||||
if (success is GetEmailContentLoading || success is RestoringEmailInlineImages) {
|
||||
return const CupertinoLoadingWidget(padding: EdgeInsets.all(16.0));
|
||||
} else {
|
||||
var newContent = success is GetEmailContentSuccess
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:dartz/dartz.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tmail_ui_user/features/base/widget/circle_loading_widget.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/state/download_image_as_base64_state.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/state/restore_email_inline_images_state.dart';
|
||||
import 'package:tmail_ui_user/features/upload/domain/state/attachment_upload_state.dart';
|
||||
|
||||
class InsertImageLoadingBarWidget extends StatelessWidget {
|
||||
@@ -38,9 +37,7 @@ class InsertImageLoadingBarWidget extends StatelessWidget {
|
||||
return viewState.fold(
|
||||
(failure) => const SizedBox.shrink(),
|
||||
(success) {
|
||||
if (success is DownloadingImageAsBase64 ||
|
||||
success is RestoringEmailInlineImages
|
||||
) {
|
||||
if (success is DownloadingImageAsBase64) {
|
||||
return CircleLoadingWidget(padding: padding);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
|
||||
Reference in New Issue
Block a user