diff --git a/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart b/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart index 7966608a71..b8f2bb98e7 100644 --- a/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart +++ b/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart @@ -225,7 +225,7 @@ class MailboxDashBoardController extends ReloadableController final filterMessageOption = FilterMessageOption.all.obs; final listEmailSelected = [].obs; final composerOverlayState = ComposerOverlayState.inActive.obs; - final viewStateMarkAsReadMailbox = Rx>(Right(UIState.idle)); + final viewStateMailboxActionProgress = Rx>(Right(UIState.idle)); final vacationResponse = Rxn(); final routerParameters = Rxn>(); final _isDraggingMailbox = RxBool(false); @@ -559,7 +559,7 @@ class MailboxDashBoardController extends ReloadableController void _registerStreamListener() { progressState.listen((state) { - viewStateMarkAsReadMailbox.value = state; + viewStateMailboxActionProgress.value = state; }); _refreshActionEventController.stream @@ -1395,6 +1395,8 @@ class MailboxDashBoardController extends ReloadableController } void _emptyTrashFolderSuccess(EmptyTrashFolderSuccess success) { + viewStateMailboxActionProgress.value = Right(UIState.idle); + if (currentOverlayContext != null && currentContext != null) { appToast.showToastSuccessMessage( currentOverlayContext!, @@ -1537,7 +1539,7 @@ class MailboxDashBoardController extends ReloadableController } void _markAsReadMailboxSuccess(Success success) { - viewStateMarkAsReadMailbox.value = Right(UIState.idle); + viewStateMailboxActionProgress.value = Right(UIState.idle); if (success is MarkAsMailboxReadAllSuccess) { if (currentContext != null && currentOverlayContext != null) { @@ -1557,7 +1559,7 @@ class MailboxDashBoardController extends ReloadableController } void _markAsReadMailboxFailure(MarkAsMailboxReadFailure failure) { - viewStateMarkAsReadMailbox.value = Right(UIState.idle); + viewStateMailboxActionProgress.value = Right(UIState.idle); if (currentOverlayContext != null && currentContext != null) { appToast.showToastErrorMessage( currentOverlayContext!, @@ -1569,7 +1571,7 @@ class MailboxDashBoardController extends ReloadableController } void _markAsReadMailboxAllFailure(MarkAsMailboxReadAllFailure failure) { - viewStateMarkAsReadMailbox.value = Right(UIState.idle); + viewStateMailboxActionProgress.value = Right(UIState.idle); if (currentOverlayContext != null && currentContext != null) { appToast.showToastErrorMessage( currentOverlayContext!, @@ -2392,6 +2394,8 @@ class MailboxDashBoardController extends ReloadableController } void _emptySpamFolderSuccess(EmptySpamFolderSuccess success) { + viewStateMailboxActionProgress.value = Right(UIState.idle); + if (currentOverlayContext != null && currentContext != null) { appToast.showToastSuccessMessage( currentOverlayContext!, @@ -2776,6 +2780,18 @@ class MailboxDashBoardController extends ReloadableController ); } + void _handleEmptySpamFolderFailure(EmptySpamFolderFailure failure) { + viewStateMailboxActionProgress.value = Right(UIState.idle); + + toastManager.showMessageFailure(failure); + } + + void _handleEmptyTrashFolderFailure(EmptyTrashFolderFailure failure) { + viewStateMailboxActionProgress.value = Right(UIState.idle); + + toastManager.showMessageFailure(failure); + } + void _handleGetRestoredDeletedMessageSuccess(GetRestoredDeletedMessageSuccess success) async { if (selectedMailbox.value != null && selectedMailbox.value!.isRecovered) { dispatchEmailUIAction(RefreshChangeEmailAction(null)); diff --git a/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart b/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart index bef9b16a6a..334c542fc8 100644 --- a/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart +++ b/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart @@ -107,7 +107,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView { responsiveUtils: controller.responsiveUtils, )), Obx(() => MarkMailboxAsReadLoadingBanner( - viewState: controller.viewStateMarkAsReadMailbox.value, + viewState: controller.viewStateMailboxActionProgress.value, )), const SpamReportBannerWebWidget(), QuotasBannerWidget(), diff --git a/lib/features/thread/presentation/thread_view.dart b/lib/features/thread/presentation/thread_view.dart index a12a60f5aa..0e06890400 100644 --- a/lib/features/thread/presentation/thread_view.dart +++ b/lib/features/thread/presentation/thread_view.dart @@ -864,7 +864,7 @@ class ThreadView extends GetWidget Widget _buildMarkAsMailboxReadLoading(BuildContext context) { return Obx(() { - final viewState = controller.mailboxDashBoardController.viewStateMarkAsReadMailbox.value; + final viewState = controller.mailboxDashBoardController.viewStateMailboxActionProgress.value; return viewState.fold( (failure) => const SizedBox.shrink(), (success) {