TF-3370 Handle SetError when make email action (Mark as read/star/move/delete)
This commit is contained in:
@@ -100,7 +100,7 @@ class ThreadIsolateWorker {
|
||||
..setIsAscending(false)),
|
||||
filter: EmailFilterCondition(inMailbox: args.mailboxId, before: lastEmail?.receivedAt),
|
||||
properties: Properties({
|
||||
EmailProperty.id,
|
||||
EmailProperty.id,
|
||||
EmailProperty.receivedAt
|
||||
}),
|
||||
);
|
||||
@@ -119,7 +119,7 @@ class ThreadIsolateWorker {
|
||||
args.session,
|
||||
args.accountId,
|
||||
newEmailList.listEmailIds);
|
||||
emailListCompleted.addAll(listEmailIdDeleted);
|
||||
emailListCompleted.addAll(listEmailIdDeleted.emailIdsSuccess);
|
||||
sendPort.send(emailListCompleted);
|
||||
} else {
|
||||
hasEmails = false;
|
||||
@@ -154,7 +154,7 @@ class ThreadIsolateWorker {
|
||||
..setIsAscending(false)),
|
||||
filter: EmailFilterCondition(inMailbox: mailboxId, before: lastEmail?.receivedAt),
|
||||
properties: Properties({
|
||||
EmailProperty.id,
|
||||
EmailProperty.id,
|
||||
EmailProperty.receivedAt
|
||||
}),
|
||||
);
|
||||
@@ -173,7 +173,7 @@ class ThreadIsolateWorker {
|
||||
session,
|
||||
accountId,
|
||||
newEmailList.listEmailIds);
|
||||
emailListCompleted.addAll(listEmailIdDeleted);
|
||||
emailListCompleted.addAll(listEmailIdDeleted.emailIdsSuccess);
|
||||
|
||||
onProgressController.add(Right<Failure, Success>(EmptyingFolderState(
|
||||
mailboxId, emailListCompleted.length, totalEmails
|
||||
|
||||
@@ -29,16 +29,16 @@ class MarkAsMultipleEmailReadInteractor {
|
||||
readAction,
|
||||
);
|
||||
|
||||
if (emailIds.length == result.length) {
|
||||
if (emailIds.length == result.emailIdsSuccess.length) {
|
||||
yield Right(MarkAsMultipleEmailReadAllSuccess(
|
||||
result.length,
|
||||
result.emailIdsSuccess.length,
|
||||
readAction,
|
||||
));
|
||||
} else if (result.isEmpty) {
|
||||
} else if (result.emailIdsSuccess.isEmpty) {
|
||||
yield Left(MarkAsMultipleEmailReadAllFailure(readAction));
|
||||
} else {
|
||||
yield Right(MarkAsMultipleEmailReadHasSomeEmailFailure(
|
||||
result.length,
|
||||
result.emailIdsSuccess.length,
|
||||
readAction,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -24,16 +24,16 @@ class MarkAsStarMultipleEmailInteractor {
|
||||
|
||||
final result = await _emailRepository.markAsStar(session, accountId, emailIds, markStarAction);
|
||||
|
||||
if (emailIds.length == result.length) {
|
||||
if (emailIds.length == result.emailIdsSuccess.length) {
|
||||
yield Right(MarkAsStarMultipleEmailAllSuccess(
|
||||
emailIds.length,
|
||||
markStarAction,
|
||||
));
|
||||
} else if (result.isEmpty) {
|
||||
} else if (result.emailIdsSuccess.isEmpty) {
|
||||
yield Left(MarkAsStarMultipleEmailAllFailure(markStarAction));
|
||||
} else {
|
||||
yield Right(MarkAsStarMultipleEmailHasSomeEmailFailure(
|
||||
result.length,
|
||||
result.emailIdsSuccess.length,
|
||||
markStarAction,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -22,20 +22,20 @@ class MoveMultipleEmailToMailboxInteractor {
|
||||
try {
|
||||
yield Right(LoadingMoveMultipleEmailToMailboxAll());
|
||||
final result = await _emailRepository.moveToMailbox(session, accountId, moveRequest);
|
||||
if (moveRequest.totalEmails == result.length) {
|
||||
if (moveRequest.totalEmails == result.emailIdsSuccess.length) {
|
||||
yield Right(MoveMultipleEmailToMailboxAllSuccess(
|
||||
result,
|
||||
result.emailIdsSuccess,
|
||||
moveRequest.currentMailboxes.keys.first,
|
||||
moveRequest.destinationMailboxId,
|
||||
moveRequest.moveAction,
|
||||
moveRequest.emailActionType,
|
||||
destinationPath: moveRequest.destinationPath,
|
||||
));
|
||||
} else if (result.isEmpty) {
|
||||
} else if (result.emailIdsSuccess.isEmpty) {
|
||||
yield Left(MoveMultipleEmailToMailboxAllFailure(moveRequest.moveAction, moveRequest.emailActionType));
|
||||
} else {
|
||||
yield Right(MoveMultipleEmailToMailboxHasSomeEmailFailure(
|
||||
result,
|
||||
result.emailIdsSuccess,
|
||||
moveRequest.currentMailboxes.keys.first,
|
||||
moveRequest.destinationMailboxId,
|
||||
moveRequest.moveAction,
|
||||
|
||||
Reference in New Issue
Block a user