Skip to content

Commit

Permalink
TF-2143 Automatically create tags for To/Cc/Bcc input when clicking…
Browse files Browse the repository at this point in the history
… open new tab
  • Loading branch information
dab246 committed Jul 8, 2024
1 parent d8655f1 commit 5bb9d58
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions lib/features/composer/presentation/composer_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -818,9 +818,7 @@ class ComposerController extends BaseController with DragDropFileMixin implement

clearFocus(context);

if (toEmailAddressController.text.isNotEmpty
|| ccEmailAddressController.text.isNotEmpty
|| bccEmailAddressController.text.isNotEmpty) {
if (_isExistRecipientInputText) {
_collapseAllRecipient();
_autoCreateEmailTag();
}
Expand Down Expand Up @@ -2305,13 +2303,26 @@ class ComposerController extends BaseController with DragDropFileMixin implement
}
}

bool get _isExistRecipientInputText {
return toEmailAddressController.text.isNotEmpty
|| ccEmailAddressController.text.isNotEmpty
|| bccEmailAddressController.text.isNotEmpty;
}

Future<void> onOpenNewTabAction() async {
if (openNewTabButtonState == ButtonState.disabled) {
log('ComposerController::onOpenNewTabAction: OPENING NEW TAB COMPOSER');
return;
}
openNewTabButtonState = ButtonState.disabled;

FocusManager.instance.primaryFocus?.unfocus();

if (_isExistRecipientInputText) {
_collapseAllRecipient();
_autoCreateEmailTag();
}

final arguments = composerArguments.value;
final session = mailboxDashBoardController.sessionCurrent;
final accountId = mailboxDashBoardController.accountId.value;
Expand Down

0 comments on commit 5bb9d58

Please sign in to comment.