diff --git a/conda/js/src/components/toolchain/ToolchainModal.jsx b/conda/js/src/components/toolchain/ToolchainModal.jsx index ff7fa184426dc64f6db1f8de49e63a6b114bfa0c..0828e6a4db154c98ab43e02151dff63dfcbf28a5 100644 --- a/conda/js/src/components/toolchain/ToolchainModal.jsx +++ b/conda/js/src/components/toolchain/ToolchainModal.jsx @@ -59,7 +59,7 @@ type Props = { type State = { }; -class ToolchainModal extends React.PureComponent<Props, State> { +class ToolchainModal extends React.Component<Props, State> { constructor(props: Props){ super(props); } @@ -67,6 +67,14 @@ class ToolchainModal extends React.PureComponent<Props, State> { state = { } + shouldComponentUpdate(nextProps: Props){ + if(nextProps.active !== this.props.active) + return true; + if(nextProps.data !== undefined && nextProps.data !== this.props.data) + return true; + return false; + } + render = () => { const data = this.props.data; if(!data) @@ -229,7 +237,10 @@ class ToolchainModal extends React.PureComponent<Props, State> { </ModalBody> <ModalFooter> <Button block color='danger' - onClick={this.props.deleteBlock} + onClick={(e) => { + this.props.deleteBlock(); + this.props.toggle(); + }} > Delete Block </Button>