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 May 31, 2024
1 parent 19c9dd6 commit 1cc848f
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 @@ -748,9 +748,7 @@ class ComposerController extends BaseController with DragDropFileMixin {

clearFocus(context);

if (toEmailAddressController.text.isNotEmpty
|| ccEmailAddressController.text.isNotEmpty
|| bccEmailAddressController.text.isNotEmpty) {
if (_isExistRecipientInputText) {
_collapseAllRecipient();
_autoCreateEmailTag();
}
Expand Down Expand Up @@ -2200,13 +2198,26 @@ class ComposerController extends BaseController with DragDropFileMixin {
bccRecipientState.value = isEnabled ? PrefixRecipientState.disabled : PrefixRecipientState.enabled;
}

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 1cc848f

Please sign in to comment.