Don’t allow manual creation of “Found in Mail” contacts because they are not synced anywhere #1722

This commit is contained in:
Ben Gotow 2020-04-16 11:21:07 -05:00
parent 8796904890
commit beee384ebb

View file

@ -28,12 +28,19 @@ class AddContactToolbarWithData extends React.Component<AddContactToolbarProps>
render() {
const { editing, perspective } = this.props;
const enabled = 'accountId' in perspective && editing === false && perspective.accountId;
const enabled =
'accountId' in perspective &&
editing === false &&
perspective.accountId &&
perspective.type !== 'found-in-mail';
const acct = 'accountId' in perspective && AccountStore.accountForId(perspective.accountId);
return (
<div style={{ display: 'flex', order: 1000 }}>
<BindGlobalCommands key={enabled} commands={enabled ? { 'core:add-item': this.onAdd } : {}}>
<BindGlobalCommands
key={`${enabled}`}
commands={enabled ? { 'core:add-item': this.onAdd } : {}}
>
<button
tabIndex={-1}
disabled={!enabled}