From 89ca4a9206fbf722576f7438730e7105d985bec7 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Tue, 2 May 2017 07:52:53 +0300 Subject: [PATCH] update --- .../addcoin/addcoinOptionsCrypto.js | 8 ++-- react/src/components/dashboard/sendCoin.js | 38 +++++++++++++------ react/src/components/dashboard/walletsData.js | 2 +- .../dashboard/walletsNativeTxHistory.js | 2 +- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/react/src/components/addcoin/addcoinOptionsCrypto.js b/react/src/components/addcoin/addcoinOptionsCrypto.js index df64b39..f5c930a 100644 --- a/react/src/components/addcoin/addcoinOptionsCrypto.js +++ b/react/src/components/addcoin/addcoinOptionsCrypto.js @@ -3,11 +3,13 @@ import { translate } from '../../translate/translate'; class AddCoinOptionsCrypto extends React.Component { render() { + // + // + // + // return ( - - @@ -16,8 +18,6 @@ class AddCoinOptionsCrypto extends React.Component { - - diff --git a/react/src/components/dashboard/sendCoin.js b/react/src/components/dashboard/sendCoin.js index 24e5043..94b27cb 100644 --- a/react/src/components/dashboard/sendCoin.js +++ b/react/src/components/dashboard/sendCoin.js @@ -197,6 +197,7 @@ class SendCoin extends React.Component { Store.dispatch(sendToAddressStateAlt(json)); } } else { + Store.dispatch(sendToAddressStateAlt(json)); Store.dispatch(triggerToaster(true, translate('TOASTR.SIGNED_TX_GENERATED_FAIL') + '.', translate('TOASTR.WALLET_NOTIFICATION'), 'error')); } console.log(json); @@ -207,14 +208,22 @@ class SendCoin extends React.Component { }, 1000);*/ } - renderSignedTx(signedtx) { - const substrBlocks = 10; - const substrLength = this.props.ActiveCoin.lastSendToResponse['signedtx'].length / substrBlocks; + renderSignedTx(isRawTx) { + let substrBlocks; + + if (this.props.ActiveCoin.mode === 'basilisk') { + substrBlocks = isRawTx ? 3 : 8; + } else { + substrBlocks = 10; + } + + const _lastSendToResponse = this.props.ActiveCoin.lastSendToResponse[isRawTx ? 'rawtx' : 'signedtx']; + const substrLength = _lastSendToResponse.length / substrBlocks; let out = []; for (let i = 0; i < substrBlocks; i++) { out.push( -
{this.props.ActiveCoin.lastSendToResponse['signedtx'].substring(i * substrLength, substrLength * i + substrLength)}
+
{_lastSendToResponse.substring(i * substrLength, substrLength * i + substrLength)}
); } @@ -224,20 +233,18 @@ class SendCoin extends React.Component { renderKey(key) { if (key === 'signedtx') { return this.renderSignedTx(); - } else if (key === 'complete') { - if (this.props.ActiveCoin.lastSendToResponse[key] === true) { + } else if (key === 'rawtx') { + return this.renderSignedTx(true); + } else if (key === 'complete' || key === 'completed' || key === 'result') { + if (this.props.ActiveCoin.lastSendToResponse[key] === true || this.props.ActiveCoin.lastSendToResponse[key] === 'success') { return ( - true + {this.props.ActiveCoin.lastSendToResponse[key] === true ? 'true' : 'success'} ); } else { return ( false ); } - } else if (key === 'result') { - return ( - {this.props.ActiveCoin.lastSendToResponse[key]} - ); } else if (key === 'error') { return ( {this.props.ActiveCoin.lastSendToResponse[key]} @@ -252,11 +259,18 @@ class SendCoin extends React.Component { false ); } + } else if (key === 'txid' || key === 'sent') { + return ( + {this.props.ActiveCoin.lastSendToResponse[key]} + ); + } else if (key === 'tag') { + return null; } } renderSendCoinResponse() { if (this.props.ActiveCoin.lastSendToResponse) { + console.log('renderSendCoinResponse', this.props.ActiveCoin.lastSendToResponse); return Object.keys(this.props.ActiveCoin.lastSendToResponse).map((key, index) => {key} @@ -401,7 +415,7 @@ class SendCoin extends React.Component {
- +
diff --git a/react/src/components/dashboard/walletsData.js b/react/src/components/dashboard/walletsData.js index 612c03e..7bac4e9 100644 --- a/react/src/components/dashboard/walletsData.js +++ b/react/src/components/dashboard/walletsData.js @@ -204,7 +204,7 @@ class WalletsData extends React.Component { renderPaginationItems() { let items = []; - for (let i=0; i <= Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) { + for (let i=0; i < Math.ceil(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) { items.push(
  • this.updateCurrentPage(i + 1) : null}>{i + 1} diff --git a/react/src/components/dashboard/walletsNativeTxHistory.js b/react/src/components/dashboard/walletsNativeTxHistory.js index e58bffc..2d86cae 100644 --- a/react/src/components/dashboard/walletsNativeTxHistory.js +++ b/react/src/components/dashboard/walletsNativeTxHistory.js @@ -105,7 +105,7 @@ class WalletsNativeTxHistory extends React.Component { renderPaginationItems() { let items = []; - for (let i=0; i <= Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) { + for (let i=0; i < Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) { items.push(
  • this.updateCurrentPage(i + 1) : null}>{i + 1}