TF-1897 Convert addSendingEmailToSendingQueue to be publicly accessible
(cherry picked from commit dc3fab425a9e90177e3f807fd5e1c063aec29e97)
This commit is contained in:
+9
-9
@@ -1808,6 +1808,7 @@ class MailboxDashBoardController extends ReloadableController {
|
|||||||
_handleUpdateSendingEmail(session, accountId, emailRequest, mailboxRequest);
|
_handleUpdateSendingEmail(session, accountId, emailRequest, mailboxRequest);
|
||||||
break;
|
break;
|
||||||
case SendingEmailActionType.delete:
|
case SendingEmailActionType.delete:
|
||||||
|
case SendingEmailActionType.resend:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1891,7 +1892,7 @@ class MailboxDashBoardController extends ReloadableController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _handleStoreSendingEmailSuccess(StoreSendingEmailSuccess success) {
|
void _handleStoreSendingEmailSuccess(StoreSendingEmailSuccess success) {
|
||||||
_addSendingEmailToSendingQueue(success.sendingEmail);
|
addSendingEmailToSendingQueue(success.sendingEmail);
|
||||||
getAllSendingEmails();
|
getAllSendingEmails();
|
||||||
if (currentOverlayContext != null && currentContext != null) {
|
if (currentOverlayContext != null && currentContext != null) {
|
||||||
_appToast.showToastSuccessMessage(
|
_appToast.showToastSuccessMessage(
|
||||||
@@ -1904,12 +1905,12 @@ class MailboxDashBoardController extends ReloadableController {
|
|||||||
|
|
||||||
void _handleUpdateSendingEmailSuccess(UpdateSendingEmailSuccess success) async {
|
void _handleUpdateSendingEmailSuccess(UpdateSendingEmailSuccess success) async {
|
||||||
await WorkSchedulerController().cancelByUniqueId(success.newSendingEmail.sendingId);
|
await WorkSchedulerController().cancelByUniqueId(success.newSendingEmail.sendingId);
|
||||||
_addSendingEmailToSendingQueue(success.newSendingEmail);
|
addSendingEmailToSendingQueue(success.newSendingEmail);
|
||||||
getAllSendingEmails();
|
getAllSendingEmails();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _addSendingEmailToSendingQueue(SendingEmail sendingEmail) async {
|
void addSendingEmailToSendingQueue(SendingEmail sendingEmail) async {
|
||||||
log('MailboxDashBoardController::_addSendingEmailToSendingQueue():sendingEmail: $sendingEmail');
|
log('MailboxDashBoardController::addSendingEmailToSendingQueue():sendingEmail: $sendingEmail');
|
||||||
final worker = worker_scheduler.Worker(
|
final worker = worker_scheduler.Worker(
|
||||||
sendingEmail.sendingId,
|
sendingEmail.sendingId,
|
||||||
WorkerType.sendingEmail,
|
WorkerType.sendingEmail,
|
||||||
@@ -1924,23 +1925,22 @@ class MailboxDashBoardController extends ReloadableController {
|
|||||||
try {
|
try {
|
||||||
await WorkSchedulerController().enqueue(workRequest);
|
await WorkSchedulerController().enqueue(workRequest);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError('MailboxDashBoardController::_addSendingEmailToSendingQueue(): EXCEPTION: $e');
|
logError('MailboxDashBoardController::addSendingEmailToSendingQueue(): EXCEPTION: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void getAllSendingEmails({bool needToReopen = false}) {
|
void getAllSendingEmails() {
|
||||||
if (accountId.value != null && sessionCurrent != null) {
|
if (accountId.value != null && sessionCurrent != null) {
|
||||||
log('MailboxDashBoardController::getAllSendingEmails():accountId: ${accountId.value} | userName: ${sessionCurrent?.username}');
|
log('MailboxDashBoardController::getAllSendingEmails():accountId: ${accountId.value} | userName: ${sessionCurrent?.username}');
|
||||||
consumeState(_getAllSendingEmailInteractor.execute(
|
consumeState(_getAllSendingEmailInteractor.execute(
|
||||||
accountId.value!,
|
accountId.value!,
|
||||||
sessionCurrent!.username,
|
sessionCurrent!.username
|
||||||
needToReopen: needToReopen
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _handleGetAllSendingEmailsSuccess(GetAllSendingEmailSuccess success) {
|
void _handleGetAllSendingEmailsSuccess(GetAllSendingEmailSuccess success) {
|
||||||
log('MailboxDashBoardController::_handleGetAllSendingEmailsSuccess():COUNT: ${success.sendingEmails.length}');
|
log('MailboxDashBoardController::_handleGetAllSendingEmailsSuccess():LIST_SENDING_EMAIL: $success');
|
||||||
listSendingEmails.value = success.sendingEmails;
|
listSendingEmails.value = success.sendingEmails;
|
||||||
|
|
||||||
if (success.sendingEmails.isEmpty && dashboardRoute.value == DashboardRoutes.sendingQueue) {
|
if (success.sendingEmails.isEmpty && dashboardRoute.value == DashboardRoutes.sendingQueue) {
|
||||||
|
|||||||
Reference in New Issue
Block a user