diff --git a/lib/features/labels/presentation/mixin/add_label_to_email_mixin.dart b/lib/features/labels/presentation/mixin/add_label_to_email_mixin.dart index b9532d2db..ac1f9b341 100644 --- a/lib/features/labels/presentation/mixin/add_label_to_email_mixin.dart +++ b/lib/features/labels/presentation/mixin/add_label_to_email_mixin.dart @@ -87,7 +87,7 @@ mixin AddLabelToEmailMixin on EmitStateMixin { emitFailure( controller: currentController, failure: AddALabelToAnEmailFailure( - exception: LabelKeywordIsNull(), + exception: const LabelKeywordIsNull(), labelDisplay: labelDisplay, ), ); @@ -151,7 +151,7 @@ mixin AddLabelToEmailMixin on EmitStateMixin { emitFailure( controller: currentController, failure: RemoveALabelFromAnEmailFailure( - exception: LabelKeywordIsNull(), + exception: const LabelKeywordIsNull(), labelDisplay: labelDisplay, ), ); diff --git a/lib/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart b/lib/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart index 618bc88df..dde4a5251 100644 --- a/lib/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart +++ b/lib/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart @@ -49,16 +49,24 @@ extension HandleLogicLabelExtension on MailboxDashBoardController { _refreshLabelSettingEnabled(); if (isEmailOpened) { - dispatchEmailUIAction( - SyncUpdateLabelForEmailOnMemory( - emailId: emailId, - labelKeyword: labelKeyword, - shouldRemove: shouldRemove, - ), - ); + _syncLabelForOpenedEmail(emailId, labelKeyword, shouldRemove); } } + void _syncLabelForOpenedEmail( + EmailId emailId, + KeyWordIdentifier labelKeyword, + bool shouldRemove, + ) { + dispatchEmailUIAction( + SyncUpdateLabelForEmailOnMemory( + emailId: emailId, + labelKeyword: labelKeyword, + shouldRemove: shouldRemove, + ), + ); + } + void _syncLabelForEmailList( EmailId emailId, KeyWordIdentifier labelKeyword,