TF-105 [BUG] Fix long line should be wrapped

This commit is contained in:
dab246
2021-10-12 16:51:30 +07:00
committed by Dat H. Pham
parent cb2c889fe2
commit dd5e8e4519
22 changed files with 243 additions and 286 deletions
@@ -15,9 +15,20 @@ class GetEmailContentInteractor {
try {
yield Right<Failure, Success>(LoadingState());
final email = await emailRepository.getEmailContent(accountId, emailId);
yield Right<Failure, Success>(GetEmailContentSuccess(
email.emailContentList,
email.allAttachments));
if (email.emailContentList.isNotEmpty) {
final emailContent = email.emailContentList.first;
if (emailContent.type == EmailContentType.textHtml) {
final contentHtml = await emailRepository.transformEmailContentToHtml(emailContent);
yield Right<Failure, Success>(GetEmailContentSuccess(
EmailContent(emailContent.type, contentHtml),
email.allAttachments));
} else {
yield Right<Failure, Success>(GetEmailContentSuccess(emailContent, email.allAttachments));
}
} else {
yield Left(GetEmailContentFailure(null));
}
} catch (e) {
yield Left(GetEmailContentFailure(e));
}