TF-348 Fix preserve the selection state when opening an email

This commit is contained in:
dab246
2022-03-25 16:55:56 +07:00
committed by Dat H. Pham
parent 0d369c1b06
commit f639fdc0d8
2 changed files with 30 additions and 3 deletions
@@ -245,7 +245,11 @@ class ThreadController extends BaseController {
void _refreshChangesAllEmailSuccess(RefreshChangesAllEmailSuccess success) {
log('ThreadController::_refreshChangesAllEmailSuccess(): ${success.emailList.length}');
_currentEmailState = success.currentEmailState;
emailList.value = success.emailList;
final emailsBeforeChanges = emailList;
final emailsAfterChanges = success.emailList;
final newListEmail = emailsAfterChanges.combine(emailsBeforeChanges);
emailList.value = newListEmail;
}
void _getAllEmailAction(AccountId accountId, {MailboxId? mailboxId}) {
@@ -675,7 +679,10 @@ class ThreadController extends BaseController {
.map((email) => email.toSearchPresentationEmail(mailboxDashBoardController.mapMailbox))
.toList();
emailListSearch.value = resultEmailSearchList;
final emailsSearchBeforeChanges = emailListSearch;
final emailsSearchAfterChanges = resultEmailSearchList;
final newListEmailSearch = emailsSearchAfterChanges.combine(emailsSearchBeforeChanges);
emailListSearch.value = newListEmailSearch;
}
void searchMoreEmails() {