mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-23 11:41:07 +08:00
Don’t allow manual creation of “Found in Mail” contacts because they are not synced anywhere #1722
This commit is contained in:
parent
8796904890
commit
beee384ebb
1 changed files with 9 additions and 2 deletions
|
@ -28,12 +28,19 @@ class AddContactToolbarWithData extends React.Component<AddContactToolbarProps>
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { editing, perspective } = this.props;
|
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);
|
const acct = 'accountId' in perspective && AccountStore.accountForId(perspective.accountId);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', order: 1000 }}>
|
<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
|
<button
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
disabled={!enabled}
|
disabled={!enabled}
|
||||||
|
|
Loading…
Add table
Reference in a new issue