TF-2188 Add Canceled sending state

(cherry picked from commit fb802e50dbdeaddabf09f450ad19a75ed7d27f39)
This commit is contained in:
dab246
2023-10-05 15:42:52 +07:00
committed by Dat H. Pham
parent 04548cb1e9
commit 2478fa4b56
7 changed files with 52 additions and 16 deletions
@@ -124,17 +124,18 @@ class SendingQueueController extends BaseController with MessageDialogActionMixi
dashboardController!.listSendingEmails.value = listSendingEmails;
}
break;
case SendingState.canceled:
case SendingState.error:
if (accountId != null && userName != null) {
final matchedSendingEmail = dashboardController?.listSendingEmails.firstWhereOrNull((sendingEmail) => sendingEmail.sendingId == sendingId);
if (matchedSendingEmail != null) {
_updateSendingEmailAction(
newSendingEmail: matchedSendingEmail.updatingSendingState(SendingState.error),
newSendingEmail: matchedSendingEmail.updatingSendingState(newState),
accountId: accountId,
userName: userName
);
} else {
_getStoredSendingEmailAction(sendingId, accountId, userName, SendingState.error);
_getStoredSendingEmailAction(sendingId, accountId, userName, newState);
}
}
break;