Fix can not refresh change list mailbox and email after take actions with email in succession

This commit is contained in:
dab246
2023-01-18 14:08:08 +07:00
committed by Dat H. Pham
parent 8587b9e8bd
commit 0f675c2270
20 changed files with 40 additions and 7 deletions
@@ -12,6 +12,8 @@ class CreateNewMailboxInteractor {
Stream<Either<Failure, Success>> execute(AccountId accountId, CreateNewMailboxRequest newMailboxRequest) async* {
try {
yield Right<Failure, Success>(LoadingCreateNewMailbox());
final currentMailboxState = await _mailboxRepository.getMailboxState();
final newMailbox = await _mailboxRepository.createNewMailbox(accountId, newMailboxRequest);
if (newMailbox != null) {
@@ -20,6 +20,8 @@ class DeleteMultipleMailboxInteractor {
List<MailboxId> listMailboxIdToDelete
) async* {
try {
yield Right<Failure, Success>(LoadingDeleteMultipleMailboxAll());
final currentMailboxState = await _mailboxRepository.getMailboxState();
final listResult = await Future.wait(
@@ -12,6 +12,8 @@ class MoveMailboxInteractor {
Stream<Either<Failure, Success>> execute(AccountId accountId, MoveMailboxRequest request) async* {
try {
yield Right<Failure, Success>(LoadingMoveMailbox());
final currentMailboxState = await _mailboxRepository.getMailboxState();
final result = await _mailboxRepository.moveMailbox(accountId, request);
if (result) {
@@ -12,6 +12,8 @@ class RenameMailboxInteractor {
Stream<Either<Failure, Success>> execute(AccountId accountId, RenameMailboxRequest request) async* {
try {
yield Right<Failure, Success>(LoadingRenameMailbox());
final currentMailboxState = await _mailboxRepository.getMailboxState();
final result = await _mailboxRepository.renameMailbox(accountId, request);
@@ -9,6 +9,8 @@ class SearchMailboxInteractor {
Stream<Either<Failure, Success>> execute(List<PresentationMailbox> mailboxes, SearchQuery searchQuery) async* {
try {
yield Right<Failure, Success>(LoadingSearchMailbox());
final resultList = mailboxes
.where((mailbox) => mailbox.name?.name.toLowerCase().contains(searchQuery.value.toLowerCase()) == true)
.toList();