TF-834 Fix in replied email, on is miss the date

This commit is contained in:
dab246
2022-08-22 11:31:30 +07:00
committed by Dat H. Pham
parent 3e32ee5ac6
commit dfdc4823a6
@@ -373,16 +373,16 @@ class ComposerController extends BaseController {
switch(arguments.emailActionType) { switch(arguments.emailActionType) {
case EmailActionType.reply: case EmailActionType.reply:
case EmailActionType.replyAll: case EmailActionType.replyAll:
final sentDate = presentationEmail.sentAt; final receivedAt = presentationEmail.receivedAt;
final emailAddress = presentationEmail.from.listEmailAddressToString(isFullEmailAddress: true); final emailAddress = presentationEmail.from.listEmailAddressToString(isFullEmailAddress: true);
return AppLocalizations.of(context).header_email_quoted( return AppLocalizations.of(context).header_email_quoted(
sentDate.formatDateToLocal(pattern: 'MMM d, y h:mm a', locale: locale), receivedAt.formatDateToLocal(pattern: 'MMM d, y h:mm a', locale: locale),
emailAddress); emailAddress);
case EmailActionType.forward: case EmailActionType.forward:
var headerQuoted = '------- ${AppLocalizations.of(context).forwarded_message} -------'.addNewLineTag(); var headerQuoted = '------- ${AppLocalizations.of(context).forwarded_message} -------'.addNewLineTag();
final subject = presentationEmail.subject ?? ''; final subject = presentationEmail.subject ?? '';
final sentDate = presentationEmail.sentAt; final receivedAt = presentationEmail.receivedAt;
final fromEmailAddress = presentationEmail.from.listEmailAddressToString(isFullEmailAddress: true); final fromEmailAddress = presentationEmail.from.listEmailAddressToString(isFullEmailAddress: true);
final toEmailAddress = presentationEmail.to.listEmailAddressToString(isFullEmailAddress: true); final toEmailAddress = presentationEmail.to.listEmailAddressToString(isFullEmailAddress: true);
final ccEmailAddress = presentationEmail.cc.listEmailAddressToString(isFullEmailAddress: true); final ccEmailAddress = presentationEmail.cc.listEmailAddressToString(isFullEmailAddress: true);
@@ -394,10 +394,10 @@ class ComposerController extends BaseController {
.append(subject) .append(subject)
.addNewLineTag(); .addNewLineTag();
} }
if (sentDate != null) { if (receivedAt != null) {
headerQuoted = headerQuoted headerQuoted = headerQuoted
.append('${AppLocalizations.of(context).date}: ') .append('${AppLocalizations.of(context).date}: ')
.append(sentDate.formatDateToLocal(pattern: 'MMM d, y h:mm a', locale: locale)) .append(receivedAt.formatDateToLocal(pattern: 'MMM d, y h:mm a', locale: locale))
.addNewLineTag(); .addNewLineTag();
} }
if (fromEmailAddress.isNotEmpty) { if (fromEmailAddress.isNotEmpty) {