diff --git a/embark-ui/src/components/ContractsDeployment.js b/embark-ui/src/components/ContractsDeployment.js index 9458dd70a..22f1ff915 100644 --- a/embark-ui/src/components/ContractsDeployment.js +++ b/embark-ui/src/components/ContractsDeployment.js @@ -112,26 +112,26 @@ class Web3Contract extends React.Component { } inputsAsArray() { - return findConstructor(this.props.contract.abiDefinition).inputs + const constructor = findConstructor(this.props.contract.abiDefinition); + if (!constructor) return []; + + return constructor.inputs .map(input => this.state.inputs[input.name]) .filter(value => value); } actionDisabled() { - return this.inputsAsArray().length !== findConstructor(this.props.contract.abiDefinition).inputs.length; + const constructor = findConstructor(this.props.contract.abiDefinition); + if (!constructor) return false; + + return this.inputsAsArray().length !== constructor.inputs.length; } render() { const abiConstructor = findConstructor(this.props.contract.abiDefinition); - const isInterface = !abiConstructor; const argumentsRequired = abiConstructor && abiConstructor.inputs.length > 0; return ( - - {isInterface && `${this.props.contract.className} is an interface`} - {!isInterface && this.props.contract.className} - - }> + {argumentsRequired && @@ -148,7 +148,7 @@ class Web3Contract extends React.Component { {!this.props.web3 && } - {this.props.web3 && !isInterface && + {this.props.web3 &&