~exprez135/mailspring-libre

e0d9843730d7ffe7a318bf4c7ae15edca9933487 — Janosch Maier 3 years ago 4153c46
Adjust search bar label based on the selected account (#2252)

1 files changed, 8 insertions(+), 1 deletions(-)

M app/internal_packages/thread-search/lib/thread-search-bar.tsx
M app/internal_packages/thread-search/lib/thread-search-bar.tsx => app/internal_packages/thread-search/lib/thread-search-bar.tsx +8 -1
@@ 7,6 7,7 @@ import {
  FocusedPerspectiveStore,
  WorkspaceStore,
  MailboxPerspective,
  AccountStore,
} from 'mailspring-exports';
import SearchStore from './search-store';
import TokenizingContenteditable from './tokenizing-contenteditable';


@@ 306,7 307,13 @@ class ThreadSearchBar extends Component<

  _placeholder = () => {
    if (this._initialQueryForPerspective() === '') {
      return localized('Search all mailboxes');
      const countMailboxes = FocusedPerspectiveStore.current()?.accountIds?.length || 0;
      if (countMailboxes == 1) {
        const account = AccountStore.accountForId(FocusedPerspectiveStore.current().accountIds[0]);
        return localized('Search') + ' ' + account.label;
      } else {
        return localized('Search all mailboxes');
      }
    }
    return localized(`Search`) + ' ' + this.props.perspective.name || '';
  };