From 421ef8b682f026da24b15c68a7543cbfa74cb765 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Fri, 11 May 2018 14:16:27 -0400 Subject: [PATCH] Added payable functionality --- .../scaffolding-react/templates/dapp.js.tpl | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/modules/scaffolding-react/templates/dapp.js.tpl b/lib/modules/scaffolding-react/templates/dapp.js.tpl index b5cfc254..023c64a0 100644 --- a/lib/modules/scaffolding-react/templates/dapp.js.tpl +++ b/lib/modules/scaffolding-react/templates/dapp.js.tpl @@ -25,8 +25,7 @@ class {{capitalize name}}Form{{@index}} extends React.Component { output: null, {{/ifview}} error: null, - mined: null, - loading: false + mined: null }; } @@ -54,13 +53,13 @@ class {{capitalize name}}Form{{@index}} extends React.Component { {{#each outputs}} {{emptyname name @index}}: result[{{@index}}]{{#unless @last}},{{/unless}} {{/each}} - }, loading: false}); + }}); {{else}} - this.setState({output: result, loading: false}); + this.setState({output: result}); {{/iflengthgt}} }) .catch((err) => { - this.setState({error: err.message, loading: false}); + this.setState({error: err.message}); }); {{else}} {{../contractName}}.methods{{methodname ../functions name inputs}}({{#each inputs}}this.state.input.{{name}}{{#unless @last}}, {{/unless}}{{/each}}) @@ -72,15 +71,15 @@ class {{capitalize name}}Form{{@index}} extends React.Component { }) .then((_receipt) => { console.log(_receipt); - this.setState({receipt: _receipt, loading: false}) + this.setState({receipt: _receipt}) }) .catch((err) => { console.log(err); - this.setState({error: err.message, loading: false}); + this.setState({error: err.message}); }); {{/ifview}} } catch(err) { - this.setState({error: err.message, loading: false}); + this.setState({error: err.message}); } } @@ -128,7 +127,7 @@ class {{capitalize name}}Form{{@index}} extends React.Component { : '' } {{#ifview stateMutability}} - + { this.state.output != null ? @@ -146,7 +145,7 @@ class {{capitalize name}}Form{{@index}} extends React.Component { : '' } {{else}} - + { this.state.receipt != null ?