fix(ui): check for projects
This commit is contained in:
parent
8286a57a73
commit
f24f8b4fbe
1 changed files with 3 additions and 1 deletions
|
|
@ -28,6 +28,7 @@ const NewSiteForm = ({
|
|||
onClose,
|
||||
mstore,
|
||||
activeSiteId,
|
||||
canDelete,
|
||||
}) => {
|
||||
const [existsError, setExistsError] = useState(false);
|
||||
|
||||
|
|
@ -115,7 +116,7 @@ const NewSiteForm = ({
|
|||
{site.exists() ? 'Update' : 'Add'}
|
||||
</Button>
|
||||
{site.exists() && (
|
||||
<Button variant="text" type="button" onClick={handleRemove}>
|
||||
<Button variant="text" type="button" onClick={handleRemove} disabled={!canDelete}>
|
||||
<Icon name="trash" size="16" />
|
||||
</Button>
|
||||
)}
|
||||
|
|
@ -132,6 +133,7 @@ const mapStateToProps = (state) => ({
|
|||
site: state.getIn(['site', 'instance']),
|
||||
siteList: state.getIn(['site', 'list']),
|
||||
loading: state.getIn(['site', 'save', 'loading']) || state.getIn(['site', 'remove', 'loading']),
|
||||
canDelete: state.getIn(['site', 'list']).size > 1,
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue