Skip to content

Commit

Permalink
Merge pull request thunderbird#6185 from arissystem/Issue-6184
Browse files Browse the repository at this point in the history
Cc and Bcc text fields checked when handling hide empty field
  • Loading branch information
cketti authored Jul 25, 2022
2 parents 3ba8a2b + d27a566 commit 351874b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ class RecipientMvpView(private val activity: MessageCompose) : View.OnFocusChang
val bccRecipients: List<Recipient>
get() = bccView.objects

val isCcTextEmpty: Boolean
get() = ccView.text.isEmpty()

val isBccTextEmpty: Boolean
get() = bccView.text.isEmpty()

fun setPresenter(presenter: RecipientPresenter) {
this.presenter = presenter
toView.setTokenListener(object : RecipientSelectView.TokenListener<Recipient> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,14 @@ class RecipientPresenter(
}

private fun hideEmptyExtendedRecipientFields() {
if (recipientMvpView.ccAddresses.isEmpty()) {
if (recipientMvpView.ccAddresses.isEmpty() && recipientMvpView.isCcTextEmpty) {
recipientMvpView.setCcVisibility(false)
if (lastFocusedType == RecipientType.CC) {
lastFocusedType = RecipientType.TO
}
}

if (recipientMvpView.bccAddresses.isEmpty()) {
if (recipientMvpView.bccAddresses.isEmpty() && recipientMvpView.isBccTextEmpty) {
recipientMvpView.setBccVisibility(false)
if (lastFocusedType == RecipientType.BCC) {
lastFocusedType = RecipientType.TO
Expand Down

0 comments on commit 351874b

Please sign in to comment.