hotfix: Do not add Reply-To to recipients field collapsed when unfocus
(cherry picked from commit aa0c27ce1c9d7fdd579d0f25c6b7d8f4b50adf70)
This commit is contained in:
@@ -599,9 +599,7 @@ class ComposerController extends BaseController
|
|||||||
richTextMobileTabletController?.richTextController.hideRichTextView();
|
richTextMobileTabletController?.richTextController.hideRichTextView();
|
||||||
}
|
}
|
||||||
autoCreateEmailTag();
|
autoCreateEmailTag();
|
||||||
if (isRecipientsNotEmpty) {
|
triggerHideRecipientsFiledsWhenUnfocus();
|
||||||
hideAllRecipients();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -720,8 +718,8 @@ class ComposerController extends BaseController
|
|||||||
listBccEmailAddress = List.from(recipients.bcc);
|
listBccEmailAddress = List.from(recipients.bcc);
|
||||||
listReplyToEmailAddress = List.from(recipients.replyTo);
|
listReplyToEmailAddress = List.from(recipients.replyTo);
|
||||||
|
|
||||||
if (isRecipientsNotEmpty) {
|
if (isRecipientsWithoutReplyToNotEmpty) {
|
||||||
hideAllRecipients();
|
hideAllRecipientsFields();
|
||||||
isInitialRecipient.value = true;
|
isInitialRecipient.value = true;
|
||||||
} else {
|
} else {
|
||||||
toRecipientState.value = PrefixRecipientState.enabled;
|
toRecipientState.value = PrefixRecipientState.enabled;
|
||||||
@@ -792,7 +790,7 @@ class ComposerController extends BaseController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listEmailAddressInvalid.isNotEmpty) {
|
if (existEmailAddressInvalid) {
|
||||||
MessageDialogActionManager().showConfirmDialogAction(context,
|
MessageDialogActionManager().showConfirmDialogAction(context,
|
||||||
appLocalizations.message_dialog_send_email_with_email_address_invalid,
|
appLocalizations.message_dialog_send_email_with_email_address_invalid,
|
||||||
appLocalizations.fix_email_addresses,
|
appLocalizations.fix_email_addresses,
|
||||||
@@ -1440,9 +1438,7 @@ class ComposerController extends BaseController
|
|||||||
|
|
||||||
void clickOutsideComposer(BuildContext context) {
|
void clickOutsideComposer(BuildContext context) {
|
||||||
clearFocus(context);
|
clearFocus(context);
|
||||||
if (isRecipientsNotEmpty) {
|
triggerHideRecipientsFiledsWhenUnfocus();
|
||||||
hideAllRecipients();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _closeComposerAction({dynamic result, bool closeOverlays = false}) {
|
void _closeComposerAction({dynamic result, bool closeOverlays = false}) {
|
||||||
@@ -1712,9 +1708,7 @@ class ComposerController extends BaseController
|
|||||||
richTextMobileTabletController?.richTextController.showDeviceKeyboard);
|
richTextMobileTabletController?.richTextController.showDeviceKeyboard);
|
||||||
}
|
}
|
||||||
autoCreateEmailTag();
|
autoCreateEmailTag();
|
||||||
if (isRecipientsNotEmpty) {
|
triggerHideRecipientsFiledsWhenUnfocus();
|
||||||
hideAllRecipients();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onChangeCursorOnMobile(List<int>? coordinates, BuildContext context) {
|
void _onChangeCursorOnMobile(List<int>? coordinates, BuildContext context) {
|
||||||
@@ -1846,9 +1840,7 @@ class ComposerController extends BaseController
|
|||||||
popBack();
|
popBack();
|
||||||
}
|
}
|
||||||
autoCreateEmailTag();
|
autoCreateEmailTag();
|
||||||
if (isRecipientsNotEmpty) {
|
triggerHideRecipientsFiledsWhenUnfocus();
|
||||||
hideAllRecipients();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FocusNode? getNextFocusOfToEmailAddress() {
|
FocusNode? getNextFocusOfToEmailAddress() {
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
Obx(() {
|
Obx(() {
|
||||||
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled) {
|
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled) {
|
||||||
return RecipientsCollapsedComposerWidget(
|
return RecipientsCollapsedComposerWidget(
|
||||||
listEmailAddress: controller.allListEmailAddress,
|
listEmailAddress: controller.allListEmailAddressWithoutReplyTo,
|
||||||
margin: ComposerStyle.mobileRecipientMargin,
|
margin: ComposerStyle.mobileRecipientMargin,
|
||||||
onShowAllRecipientsAction: controller.showFullRecipients,
|
onShowAllRecipientsAction: controller.showFullRecipients,
|
||||||
);
|
);
|
||||||
@@ -307,7 +307,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
Obx(() {
|
Obx(() {
|
||||||
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled) {
|
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled) {
|
||||||
return RecipientsCollapsedComposerWidget(
|
return RecipientsCollapsedComposerWidget(
|
||||||
listEmailAddress: controller.allListEmailAddress,
|
listEmailAddress: controller.allListEmailAddressWithoutReplyTo,
|
||||||
margin: ComposerStyle.mobileRecipientMargin,
|
margin: ComposerStyle.mobileRecipientMargin,
|
||||||
onShowAllRecipientsAction: controller.showFullRecipients,
|
onShowAllRecipientsAction: controller.showFullRecipients,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
),
|
),
|
||||||
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled)
|
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled)
|
||||||
RecipientsCollapsedComposerWidget(
|
RecipientsCollapsedComposerWidget(
|
||||||
listEmailAddress: controller.allListEmailAddress,
|
listEmailAddress: controller.allListEmailAddressWithoutReplyTo,
|
||||||
margin: ComposerStyle.mobileRecipientMargin,
|
margin: ComposerStyle.mobileRecipientMargin,
|
||||||
onShowAllRecipientsAction: controller.showFullRecipients,
|
onShowAllRecipientsAction: controller.showFullRecipients,
|
||||||
),
|
),
|
||||||
@@ -349,7 +349,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
),
|
),
|
||||||
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled)
|
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled)
|
||||||
RecipientsCollapsedComposerWidget(
|
RecipientsCollapsedComposerWidget(
|
||||||
listEmailAddress: controller.allListEmailAddress,
|
listEmailAddress: controller.allListEmailAddressWithoutReplyTo,
|
||||||
margin: ComposerStyle.desktopRecipientMargin,
|
margin: ComposerStyle.desktopRecipientMargin,
|
||||||
onShowAllRecipientsAction: controller.showFullRecipients,
|
onShowAllRecipientsAction: controller.showFullRecipients,
|
||||||
),
|
),
|
||||||
@@ -617,7 +617,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
),
|
),
|
||||||
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled)
|
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled)
|
||||||
RecipientsCollapsedComposerWidget(
|
RecipientsCollapsedComposerWidget(
|
||||||
listEmailAddress: controller.allListEmailAddress,
|
listEmailAddress: controller.allListEmailAddressWithoutReplyTo,
|
||||||
margin: ComposerStyle.desktopRecipientMargin,
|
margin: ComposerStyle.desktopRecipientMargin,
|
||||||
onShowAllRecipientsAction: controller.showFullRecipients,
|
onShowAllRecipientsAction: controller.showFullRecipients,
|
||||||
),
|
),
|
||||||
|
|||||||
+32
-7
@@ -12,17 +12,25 @@ extension HandleRecipientsCollapsedExtensions on ComposerController {
|
|||||||
listBccEmailAddress +
|
listBccEmailAddress +
|
||||||
listReplyToEmailAddress;
|
listReplyToEmailAddress;
|
||||||
|
|
||||||
List<EmailAddress> get listEmailAddressInvalid => allListEmailAddress
|
List<EmailAddress> get allListEmailAddressWithoutReplyTo =>
|
||||||
.where(
|
listToEmailAddress +
|
||||||
|
listCcEmailAddress +
|
||||||
|
listBccEmailAddress;
|
||||||
|
|
||||||
|
bool get existEmailAddressInvalid => allListEmailAddress
|
||||||
|
.any(
|
||||||
(emailAddress) => !EmailUtils.isEmailAddressValid(
|
(emailAddress) => !EmailUtils.isEmailAddressValid(
|
||||||
emailAddress.emailAddress,
|
emailAddress.emailAddress,
|
||||||
),
|
),
|
||||||
)
|
);
|
||||||
.toList();
|
|
||||||
|
|
||||||
bool get isRecipientsNotEmpty => listToEmailAddress.isNotEmpty ||
|
bool get isRecipientsWithoutReplyToNotEmpty => listToEmailAddress.isNotEmpty ||
|
||||||
listCcEmailAddress.isNotEmpty ||
|
listCcEmailAddress.isNotEmpty ||
|
||||||
listBccEmailAddress.isNotEmpty ||
|
listBccEmailAddress.isNotEmpty;
|
||||||
|
|
||||||
|
bool get isRecipientsEmptyExceptReplyTo => listToEmailAddress.isEmpty &&
|
||||||
|
listCcEmailAddress.isEmpty &&
|
||||||
|
listBccEmailAddress.isEmpty &&
|
||||||
listReplyToEmailAddress.isNotEmpty;
|
listReplyToEmailAddress.isNotEmpty;
|
||||||
|
|
||||||
void showFullRecipients() {
|
void showFullRecipients() {
|
||||||
@@ -90,7 +98,15 @@ extension HandleRecipientsCollapsedExtensions on ComposerController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void hideAllRecipients() {
|
void triggerHideRecipientsFiledsWhenUnfocus() {
|
||||||
|
if (isRecipientsEmptyExceptReplyTo) {
|
||||||
|
hideAllRecipientsFieldsExceptTo();
|
||||||
|
} else if (isRecipientsWithoutReplyToNotEmpty) {
|
||||||
|
hideAllRecipientsFields();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void hideAllRecipientsFields() {
|
||||||
fromRecipientState.value = PrefixRecipientState.disabled;
|
fromRecipientState.value = PrefixRecipientState.disabled;
|
||||||
toRecipientState.value = PrefixRecipientState.disabled;
|
toRecipientState.value = PrefixRecipientState.disabled;
|
||||||
ccRecipientState.value = PrefixRecipientState.disabled;
|
ccRecipientState.value = PrefixRecipientState.disabled;
|
||||||
@@ -98,4 +114,13 @@ extension HandleRecipientsCollapsedExtensions on ComposerController {
|
|||||||
replyToRecipientState.value = PrefixRecipientState.disabled;
|
replyToRecipientState.value = PrefixRecipientState.disabled;
|
||||||
recipientsCollapsedState.value = PrefixRecipientState.enabled;
|
recipientsCollapsedState.value = PrefixRecipientState.enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void hideAllRecipientsFieldsExceptTo() {
|
||||||
|
toRecipientState.value = PrefixRecipientState.enabled;
|
||||||
|
fromRecipientState.value = PrefixRecipientState.disabled;
|
||||||
|
ccRecipientState.value = PrefixRecipientState.disabled;
|
||||||
|
bccRecipientState.value = PrefixRecipientState.disabled;
|
||||||
|
replyToRecipientState.value = PrefixRecipientState.disabled;
|
||||||
|
recipientsCollapsedState.value = PrefixRecipientState.disabled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user