diff --git a/lib/features/thread/presentation/thread_view.dart b/lib/features/thread/presentation/thread_view.dart index 0646efad3..43b0200bd 100644 --- a/lib/features/thread/presentation/thread_view.dart +++ b/lib/features/thread/presentation/thread_view.dart @@ -611,46 +611,57 @@ class ThreadView extends GetWidget isLabelMailboxOpened: isLabelMailboxOpened, labels: emailLabels, emailActionClick: _handleEmailActionClicked, - onMoreActionClick: (email, position) async { - await openMoreActionContextMenu( - EmailContextMenuParams( - context: context, - email: email, - imagePaths: controller.imagePaths, - isLabelAvailable: isLabelAvailable, - labels: listLabels, - position: position, - openBottomSheetContextMenu: dashboardController.openBottomSheetContextMenu, - openPopupMenu: dashboardController.openPopupMenuActionGroup, - onHandleEmailByActionType: controller.handleEmailActionType, - onSelectLabelAction: (label, isSelected) { - final emailId = presentationEmail.id; - if (emailId == null) { - logWarning('ThreadView::onSelectLabelAction: Email id is null'); - return; - } - dashboardController.toggleLabelToEmail( - emailId, - label, - isSelected, - ); - }, - onCreateANewLabelAction: () { - dashboardController.labelController.handleLabelActionType( - actionType: LabelActionType.create, - accountId: dashboardController.accountId.value, - onLabelActionCallback: (label) => dashboardController - .toggleLabelToEmail(email.id!, label, true), - ); - }, - ), - ); - } + onMoreActionClick: (email, position) => _openMoreActionForEmail( + context: context, + email: email, + position: position, + isLabelAvailable: isLabelAvailable, + listLabels: listLabels, + ), ), ); }); } + Future _openMoreActionForEmail({ + required BuildContext context, + required PresentationEmail email, + required RelativeRect? position, + required bool isLabelAvailable, + required List