diff --git a/lib/modules/scaffolding-react/templates/dapp.js.hbs b/lib/modules/scaffolding-react/templates/dapp.js.hbs index 7a857ba1..fa2ea243 100644 --- a/lib/modules/scaffolding-react/templates/dapp.js.hbs +++ b/lib/modules/scaffolding-react/templates/dapp.js.hbs @@ -5,6 +5,9 @@ import React, { Component, Fragment } from 'react'; import ReactDOM from 'react-dom'; import { FormGroup, ControlLabel, FormControl, Checkbox, Button, Alert, InputGroup } from 'react-bootstrap'; +function isSuccess(status) { + return status === "0x1" || status === true; +} {{#each functions}} class {{capitalize name}}Form{{@index}} extends Component { @@ -50,7 +53,7 @@ class {{capitalize name}}Form{{@index}} extends Component { try { {{#ifview stateMutability}} - const result = await {{../contractName}}.methods{{methodname ../functions name inputs}}({{#each inputs}}input.{{#ifeq name ''}}field{{else}}{{trim name}}{{/ifeq}}{{#unless @last}}, {{/unless}}{{/each}}).call() + const result = await {{../contractName}}.methods{{methodname ../functions name inputs}}({{#each inputs}}input.{{#ifeq name ''}}field{{else}}{{trim name}}{{/ifeq}}{{#unless @last}}, {{/unless}}{{/each}}).call(); {{#iflengthgt outputs 1}} this.setState({output: { {{#each outputs}} @@ -141,7 +144,7 @@ class {{capitalize name}}Form{{@index}} extends Component { {{#iflengthgt outputs 1}}