From 1d6d48b6e5648a41bd8d85d32d83813d8023ff25 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 29 Jul 2017 16:52:20 +0300 Subject: [PATCH 01/30] skip dashboard section render --- react/change.log | 1 + .../dashboard/main/dashboard.render.js | 20 ++++++------- .../dashboard/receiveCoin/receiveCoin.js | 12 ++++---- .../dashboard/sendCoin/sendCoin.render.js | 12 ++++---- .../components/dashboard/settings/settings.js | 28 +++++++++++-------- .../dashboard/settings/settings.render.js | 8 +++--- 6 files changed, 43 insertions(+), 38 deletions(-) diff --git a/react/change.log b/react/change.log index c376a6b..1707398 100644 --- a/react/change.log +++ b/react/change.log @@ -13,6 +13,7 @@ UI: - reset app setting to default - manual balance / transactions list refresh - quick access dropdown on login to open settings / about / sync only modals +- qr code v0.2.0.21a-beta -------------- diff --git a/react/src/components/dashboard/main/dashboard.render.js b/react/src/components/dashboard/main/dashboard.render.js index 580f60e..59b5b98 100644 --- a/react/src/components/dashboard/main/dashboard.render.js +++ b/react/src/components/dashboard/main/dashboard.render.js @@ -36,21 +36,21 @@ const DashboardRender = function() { -
+ { this.isSectionActive('edex') && -
-
+ } + { this.isSectionActive('atomic') && -
-
+ } + { this.isSectionActive('jumblr') && -
-
+ } + { this.isSectionActive('settings') && -
-
+ } + { this.isSectionActive('about') && -
+ } ); diff --git a/react/src/components/dashboard/receiveCoin/receiveCoin.js b/react/src/components/dashboard/receiveCoin/receiveCoin.js index 9193512..e440235 100644 --- a/react/src/components/dashboard/receiveCoin/receiveCoin.js +++ b/react/src/components/dashboard/receiveCoin/receiveCoin.js @@ -123,15 +123,15 @@ class ReceiveCoin extends React.Component { if (this.isBasiliskMode() && this.hasNoAmount(address)) { - address.amount = _cache && _cache[_coin][address.address] - && _cache[_coin][address.address].getbalance.data - && _cache[_coin][address.address].getbalance.data.balance ? _cache[_coin][address.address].getbalance.data.balance : 'N/A'; + address.amount = _cache && _cache[_coin][address.address] && + _cache[_coin][address.address].getbalance.data && + _cache[_coin][address.address].getbalance.data.balance ? _cache[_coin][address.address].getbalance.data.balance : 'N/A'; } if (this.isBasiliskMode() && this.hasNoInterest(address)) { - address.interest = _cache && _cache[_coin][address.address] - && _cache[_coin][address.address].getbalance.data - && _cache[_coin][address.address].getbalance.data.interest ? _cache[_coin][address.address].getbalance.data.interest : 'N/A'; + address.interest = _cache && _cache[_coin][address.address] && + _cache[_coin][address.address].getbalance.data && + _cache[_coin][address.address].getbalance.data.interest ? _cache[_coin][address.address].getbalance.data.interest : 'N/A'; } items.push( diff --git a/react/src/components/dashboard/sendCoin/sendCoin.render.js b/react/src/components/dashboard/sendCoin/sendCoin.render.js index a7fc0a5..9e313ee 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.render.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.render.js @@ -9,10 +9,10 @@ export const UTXOCacheInfoRender = function(refreshCacheData, isReadyToUpdate, w return (

- { translate('SEND.TOTAL_UTXO_AVAILABLE') }: + { translate('SEND.TOTAL_UTXO_AVAILABLE') }: { refreshCacheData ? refreshCacheData.data && refreshCacheData.data.length : translate('SEND.PRESS_UPDATE_BTN') }
- { translate('SEND.LAST_UPDATED') } @ + { translate('SEND.LAST_UPDATED') } @ { secondsToString(refreshCacheData ? refreshCacheData.timestamp : 0, true) } |  { secondsElapsedToString(timestamp || 0) }&nbps; { translate('SEND.AGO') }
@@ -38,7 +38,7 @@ export const UTXOCacheInfoRender = function(refreshCacheData, isReadyToUpdate, w ); }; -export const SendCoinResponseRender = function () { +export const SendCoinResponseRender = function() { if (this.props.ActiveCoin.lastSendToResponse) { let items = []; const _response = this.props.ActiveCoin.lastSendToResponse; @@ -105,7 +105,7 @@ export const SendCoinResponseRender = function () { } } -export const OASendUIRender = function () { +export const OASendUIRender = function() { return (
@@ -134,7 +134,7 @@ export const OASendUIRender = function () { ); }; -export const SendApiTypeSelectorRender = function () { +export const SendApiTypeSelectorRender = function() { return (
@@ -158,7 +158,7 @@ export const SendApiTypeSelectorRender = function () { ); }; -export const SendCoinRender = function () { +export const SendCoinRender = function() { return (
diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 3d5f74d..ed3baa2 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -207,23 +207,27 @@ class Settings extends React.Component { for (let i = 0; i < this.state.updateLog.length; i++) { items.push( -
{ this.state.updateLog[i] }
+
{ this.state.updateLog[i] }
); } - return ( -
-
-
Progress:
-
{ items }
-
-1 ? 'progress progress-sm' : 'hide' }> -
+ if (this.state.updateLog.length) { + return ( +
+
+
Progress:
+
{ items }
+
-1 ? 'progress progress-sm' : 'hide' }> +
+
-
- ); + ); + } else { + return null; + } } toggleSeedInputVisibility() { diff --git a/react/src/components/dashboard/settings/settings.render.js b/react/src/components/dashboard/settings/settings.render.js index c6a0ddc..ebf4d97 100644 --- a/react/src/components/dashboard/settings/settings.render.js +++ b/react/src/components/dashboard/settings/settings.render.js @@ -24,7 +24,7 @@ export const AppUpdateTabRender = function() {
- + ); }; @@ -76,8 +72,9 @@ export const ReceiveCoinRender = function() {
{this.isNativeMode() &&
-
+
{ translate('INDEX.GET_NEW_ADDRESS') } diff --git a/react/src/components/dashboard/settings/settings.render.js b/react/src/components/dashboard/settings/settings.render.js index ebf4d97..aa17e53 100644 --- a/react/src/components/dashboard/settings/settings.render.js +++ b/react/src/components/dashboard/settings/settings.render.js @@ -593,7 +593,7 @@ export const SettingsRender = function() { diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index 84dc35d..74fe8f3 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -64,7 +64,6 @@ class WalletsData extends React.Component { this.basiliskRefreshActionOne = this.basiliskRefreshActionOne.bind(this); this.handleClickOutside = this.handleClickOutside.bind(this); this.refreshTxHistory = this.refreshTxHistory.bind(this); - socket.on('messages', msg => this.updateSocketsData(msg)); } componentWillMount() { @@ -73,6 +72,14 @@ class WalletsData extends React.Component { this.handleClickOutside, false ); + + setTimeout(() => { + if (this.props.ActiveCoin.mode === 'basilisk') { + socket.on('messages', msg => this.updateSocketsData(msg)); + } else { + socket.removeAllListeners('messages'); + } + }, 100); } componentWillUnmount() { @@ -81,6 +88,8 @@ class WalletsData extends React.Component { this.handleClickOutside, false ); + + socket.removeAllListeners('messages'); } handleClickOutside(e) { @@ -576,8 +585,14 @@ class WalletsData extends React.Component { if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.coin && - !this.props.ActiveCoin.send && - !this.props.ActiveCoin.receive) { + ( + this.props.ActiveCoin.mode !== 'native' && + !this.props.ActiveCoin.send && + !this.props.ActiveCoin.receive + ) || ( + this.props.ActiveCoin.mode === 'native' && + this.props.ActiveCoin.nativeActiveSection === 'default' + )) { return WalletsDataRender.call(this); } else { return null; diff --git a/react/src/translate/translate.js b/react/src/translate/translate.js index 060f05d..631141b 100644 --- a/react/src/translate/translate.js +++ b/react/src/translate/translate.js @@ -13,13 +13,13 @@ export function translate(langID) { _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) { return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]; } else { - console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); - return '--> ' + langID + ' <--'; + console.warn(`Missing translation ${langID} in js/${defaultLang.toLowerCase()}.js`); + return `--> ${langID} <--`; } } else { if (langID.length) { - console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); - return '--> ' + langID + ' <--'; + console.warn(`Missing translation ${langID} in js/${defaultLang.toLowerCase()}.js`); + return `--> ${langID} <--`; } } } \ No newline at end of file From e92185997f9a9400e2c3f5032a452bf9a4396cc0 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 29 Jul 2017 23:47:49 +0300 Subject: [PATCH 04/30] equal balance boxes height --- .../walletsBalance/walletsBalance.render.js | 6 ++--- .../walletsNativeSend/walletsNativeSend.js | 21 ++++++++++++------ .../walletsNativeSend.render.js | 8 +++---- react/src/components/overrides.scss | 22 +++++++++++++++++++ 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js index 6ce2b32..e00db48 100644 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js @@ -5,8 +5,8 @@ import Config from '../../../config'; const WalletsBalanceRender = function() { return ( -
-
+
+

{ translate('INDEX.ACTIVATING_WALLET_RT') }

@@ -23,7 +23,7 @@ const WalletsBalanceRender = function() {
-
+
- { this.zAddressCount && + { this.state.renderAddressDropdown &&
@@ -104,7 +104,7 @@ export const WalletsNativeSendRender = function() {
- { translate('INDEX.TOTAL') }: - { this.state.amount } - { this.state.fee }/kb = { Number(this.state.amount) - Number(this.state.fee) } + { translate('INDEX.TOTAL') }:  + { this.state.amount } - { this.state.fee }/kb = { Number(this.state.amount) - Number(this.state.fee) }  { this.props.ActiveCoin.coin }
diff --git a/react/src/components/overrides.scss b/react/src/components/overrides.scss index 5bee66c..c3af91e 100644 --- a/react/src/components/overrides.scss +++ b/react/src/components/overrides.scss @@ -648,4 +648,26 @@ select{ position: absolute; right: 4px; top: 3px; +} + +@media only screen and (min-width : 1201px) { + .wallet-widgets { + .flex { + display: flex; + flex-wrap: wrap; + } + > div { + display: flex; + + .widget, + .widget-content { + height: 100%; + + > div, + .clearfix { + height: 100%; + } + } + } + } } \ No newline at end of file From 6b3950e80be86ccd600e8deed18007b5c1c15198 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 29 Jul 2017 23:49:00 +0300 Subject: [PATCH 05/30] disabled fee, total, dropdown (t-tx) in native send --- .../walletsNativeSend/walletsNativeSend.js | 2 +- .../walletsNativeSend.render.js | 82 ++++++++++--------- 2 files changed, 43 insertions(+), 41 deletions(-) diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index 310a9b1..fe2cec2 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -25,7 +25,7 @@ class WalletsNativeSend extends React.Component { sendTo: '', sendToOA: null, amount: 0, - fee: 0.0001, + fee: 0, addressSelectorOpen: false, renderAddressDropdown: true, }; diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js index 986b309..3d2f986 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js @@ -100,7 +100,7 @@ export const WalletsNativeSendRender = function() { autoComplete="off" required />
-
+
-
+
-
+
{ translate('INDEX.TOTAL') }:  { this.state.amount } - { this.state.fee }/kb = { Number(this.state.amount) - Number(this.state.fee) }  @@ -143,7 +143,7 @@ export const WalletsNativeSendRender = function() { type="button" className="btn btn-primary waves-effect waves-light pull-right" onClick={ this.handleSubmit } - disabled={ !this.state.sendFrom || !this.state.sendTo || !this.state.amount }> + disabled={ (!this.state.sendFrom && this.state.renderAddressDropdown) || !this.state.sendTo || !this.state.amount }> { translate('INDEX.SEND') } { this.state.amount } { this.props.ActiveCoin.coin }
@@ -153,48 +153,50 @@ export const WalletsNativeSendRender = function() {
-
-
-
-
-
-
-
-

- { translate('INDEX.OPERATIONS_STATUSES') } -

-
-
- - - - - - - - - - - { this.renderOPIDList() } - - - - - - - - - -
{ translate('INDEX.STATUS') }ID{ translate('INDEX.TIME') }{ translate('INDEX.RESULT') }
{ translate('INDEX.STATUS') }ID{ translate('INDEX.TIME') }{ translate('INDEX.RESULT') }
+ { this.state.renderAddressDropdown && +
+
+
+
+
+
+
+

+ { translate('INDEX.OPERATIONS_STATUSES') } +

+
+
+ + + + + + + + + + + { this.renderOPIDList() } + + + + + + + + + +
{ translate('INDEX.STATUS') }ID{ translate('INDEX.TIME') }{ translate('INDEX.RESULT') }
{ translate('INDEX.STATUS') }ID{ translate('INDEX.TIME') }{ translate('INDEX.RESULT') }
+
-
+ }
); }; \ No newline at end of file From 058bafa29350a217deb104935c2b94c4aff9f7f9 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 29 Jul 2017 23:49:31 +0300 Subject: [PATCH 06/30] switched date sorting to conf --- react/src/actions/actions/nativeSend.js | 11 ++++++----- .../components/dashboard/walletsData/walletsData.js | 4 +++- .../dashboard/walletsData/walletsData.render.js | 8 ++++---- react/src/util/sort.js | 8 ++++---- react/src/util/time.js | 2 +- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/react/src/actions/actions/nativeSend.js b/react/src/actions/actions/nativeSend.js index 8fea38e..cde0cfe 100644 --- a/react/src/actions/actions/nativeSend.js +++ b/react/src/actions/actions/nativeSend.js @@ -16,8 +16,9 @@ export function sendNativeTx(coin, _payload) { let payload; let _apiMethod; - if (_payload.addressType === 'public' && // transparent - _payload.sendTo.length !== 95) { + // iguana core + if ((_payload.addressType === 'public' && // transparent + _payload.sendTo.length !== 95) || !_payload.sendFrom) { _apiMethod = 'sendtoaddress'; ajaxDataToHex = `["${_payload.sendTo}", ${Number(_payload.amount) - Number(_payload.fee)}]`; } else { // private @@ -61,13 +62,13 @@ export function sendNativeTx(coin, _payload) { body: JSON.stringify(payload), }; - if (Config.cli.default) { + if (Config.cli.default) { // rpc payload = { mode: null, chain: coin, cmd: payload.function, params: - _payload.addressType === 'public' && _payload.sendTo.length !== 95 ? + (_payload.addressType === 'public' && _payload.sendTo.length !== 95) || !_payload.sendFrom ? [ _payload.sendTo, _payload.amount @@ -123,7 +124,7 @@ export function sendNativeTx(coin, _payload) { if (json.indexOf('"code":') > -1) { const _message = json.substring( - `${json.indexOf('"message":"')}11`, + `${json.indexOf('"message":"')}11`, json.indexOf('"},"id":"jl777"') ); diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index 74fe8f3..52f2bc0 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -485,7 +485,9 @@ class WalletsData extends React.Component { _amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A'; } - _amount = formatValue('round', _amount, -6); + if (_amount !== 'N/A') { + _amount = formatValue('round', _amount, -6); + } items.push(
  • diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index 078e2b0..13d77f3 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -177,19 +177,19 @@ export const WalletsDataRender = function() {
      -
    • +
    • { translate('INDEX.GET_NOTARY_NODES_LIST') }
    • -
    • +
    • { translate('INDEX.REFRESH_BASILISK_CONNECTIONS') }
    • - { translate('INDEX.FETCH_WALLET_DATA') } + { translate('INDEX.FETCH_WALLET_DATA') }  ({ translate('INDEX.ACTIVE_ADDRESS') })
    • @@ -209,7 +209,7 @@ export const WalletsDataRender = function() { Restart Basilisk Instance (unsafe!) -
    • +
    • { translate('INDEX.VIEW_CACHE_DATA') } diff --git a/react/src/util/sort.js b/react/src/util/sort.js index 3ae1063..5904c6b 100644 --- a/react/src/util/sort.js +++ b/react/src/util/sort.js @@ -1,10 +1,10 @@ export function sortByDate(data) { return data.sort(function(a, b) { - if (a.timestamp && - b.timestamp) { - return b.timestamp - a.timestamp; + if (a.confirmations && + b.confirmations) { + return a.confirmations - b.confirmations; } else { - return b.blocktime - a.blocktime; + return a.confirmations - b.confirmations; } }); } \ No newline at end of file diff --git a/react/src/util/time.js b/react/src/util/time.js index 1e65f2b..a768ffe 100644 --- a/react/src/util/time.js +++ b/react/src/util/time.js @@ -18,7 +18,7 @@ export function secondsToString(seconds, skipMultiply, showSeconds) { month = months[a.getMonth()], date = a.getDate(), hour = a.getHours() < 10 ? `0${a.getHours()}` : a.getHours(), - min = a.getMinutes() < 10 ? `0 ${a.getMinutes()}` : a.getMinutes(), + min = a.getMinutes() < 10 ? `0${a.getMinutes()}` : a.getMinutes(), sec = a.getSeconds(), time = `${date} ${month} ${year} ${hour}:${min}${(showSeconds ? ':' + sec : '')}`; From 0add574d631c8fa36ce093f575a9c2178a5af0d2 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 30 Jul 2017 13:25:54 +0300 Subject: [PATCH 07/30] basilisk send res render bug fix --- react/src/components/dashboard/sendCoin/sendCoin.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index 39566aa..506881c 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -697,6 +697,8 @@ class SendCoin extends React.Component { ); } } else if (key === 'sendrawtransaction') { + const _lastSendToResponse = this.props.ActiveCoin.lastSendToResponse; + if (_lastSendToResponse[key] === 'success') { return ( true @@ -707,6 +709,8 @@ class SendCoin extends React.Component { ); } } else if (key === 'txid' || key === 'sent') { + const _lastSendToResponse = this.props.ActiveCoin.lastSendToResponse; + return ( { _lastSendToResponse[key] } ); From f945c5e5e577e12323fe06a3c6dc3b87e07883b8 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 30 Jul 2017 16:57:10 +0300 Subject: [PATCH 08/30] moved copy text field to walletMain comp --- react/src/components/main/walletMain.js | 1 + react/www/index.html | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/react/src/components/main/walletMain.js b/react/src/components/main/walletMain.js index 6c291ca..65e0e5c 100644 --- a/react/src/components/main/walletMain.js +++ b/react/src/components/main/walletMain.js @@ -10,6 +10,7 @@ class WalletMain extends React.Component { render() { return (
      + diff --git a/react/www/index.html b/react/www/index.html index d8d2d3a..8b1eb3a 100644 --- a/react/www/index.html +++ b/react/www/index.html @@ -1,21 +1,20 @@ - - - - - - Agama (v0.2.0.21a-beta) - - - - - - + + + + + + Agama (v0.2.0.21a-beta) + + + + + + -
      From 6749b830871f52d9ea8b495ef4dfd69f1c91acab Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 30 Jul 2017 17:06:57 +0300 Subject: [PATCH 09/30] set app title from main comp --- react/src/components/main/main.js | 10 ++++++++++ react/www/index.html | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/react/src/components/main/main.js b/react/src/components/main/main.js index 9f18b85..e8350c0 100644 --- a/react/src/components/main/main.js +++ b/react/src/components/main/main.js @@ -23,6 +23,16 @@ class Main extends React.Component { } componentDidMount() { + let appVersion; + + try { + appVersion = window.require('electron').remote.getCurrentWindow().appBasicInfo; + } catch (e) {} + + if (appVersion) { + document.title = `${appVersion.name} (v${appVersion.version})`; + } + Store.dispatch(iguanaActiveHandle()); const _iguanaActiveHandle = setInterval(function() { Store.dispatch(iguanaActiveHandle()); diff --git a/react/www/index.html b/react/www/index.html index 8b1eb3a..3b7aa4c 100644 --- a/react/www/index.html +++ b/react/www/index.html @@ -6,7 +6,7 @@ - Agama (v0.2.0.21a-beta) + Agama From 0485951b522fd9302d2a37408257b6eaf55ec60c Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 30 Jul 2017 18:50:53 +0300 Subject: [PATCH 10/30] settings comp sockets mount/unmount --- react/src/components/dashboard/settings/settings.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index ed3baa2..bb31959 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -79,9 +79,16 @@ class Settings extends React.Component { this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this); this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this); this._updateUIPromise = this._updateUIPromise.bind(this); + } + + componentWillMount() { socket.on('patch', msg => this.updateSocketsData(msg)); } + componentWillUnmount() { + socket.removeAllListeners('patch', msg => this.updateSocketsData(msg)); + } + componentDidMount() { if (!this.props.disableWalletSpecificUI) { Store.dispatch(iguanaActiveHandle()); From 311552cbb9d92768679f80a8d1782bf832bd0e1f Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 30 Jul 2017 18:51:34 +0300 Subject: [PATCH 11/30] basilisk send form reset bug fix --- .../components/dashboard/sendCoin/sendCoin.js | 2 +- .../dashboard/sendCoin/sendCoin.render.js | 106 +++++++++--------- .../dashboard/walletsData/walletsData.js | 48 ++++---- react/src/components/main/main.js | 2 +- react/src/components/overrides.scss | 8 ++ react/src/util/time.js | 6 +- 6 files changed, 94 insertions(+), 78 deletions(-) diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index 506881c..14a43f4 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -395,7 +395,7 @@ class SendCoin extends React.Component { amount: 0, fee: 0.0001, sendSig: false, - sendApiType: false, + sendApiType: true, addressSelectorOpen: false, currentStackLength: 0, totalStackLength: 0, diff --git a/react/src/components/dashboard/sendCoin/sendCoin.render.js b/react/src/components/dashboard/sendCoin/sendCoin.render.js index 3745132..86b9da5 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.render.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.render.js @@ -8,6 +8,8 @@ import { import QRModal from '../qrModal/qrModal'; export const UTXOCacheInfoRender = function(refreshCacheData, isReadyToUpdate, waitUntilCallIsFinished, timestamp) { + const _progress = 100 - this.state.currentStackLength * 100 / this.state.totalStackLength; + return (

      @@ -25,7 +27,7 @@ export const UTXOCacheInfoRender = function(refreshCacheData, isReadyToUpdate, w
      + style={{ width: `${_progress}%` }}> { translate('SEND.PROCESSING_REQ') }: { this.state.currentStackLength } / { this.state.totalStackLength }
      @@ -59,50 +61,54 @@ export const SendCoinResponseRender = function() { return items; } else { return ( -
      -
      - { translate('SEND.PROCESSING_TRANSACTION') }...
      - { translate('SEND.NOTE_IT_WILL_TAKE') }. -
      -
      -
      -
      -
      + + +
      +
      + { translate('SEND.PROCESSING_TRANSACTION') }...
      + { translate('SEND.NOTE_IT_WILL_TAKE') }.
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      -
      -
      + + ); } } @@ -144,7 +150,8 @@ export const SendApiTypeSelectorRender = function() {
      @@ -247,9 +254,8 @@ export const SendCoinRender = function() { className="form-control" id="edexcoinAmount" name="amount" - placeholder="0.000" + placeholder="0.001" autoComplete="off" - defaultValue={ this.state.amount } value={ this.state.amount } onChange={ this.updateInput } />
      @@ -264,16 +270,15 @@ export const SendCoinRender = function() { className="form-control" id="edexcoinFee" name="fee" - defaultValue={ this.state.fee } value={ this.state.fee } - placeholder="0.000" + placeholder="0.001" autoComplete="off" onChange={ this.updateInput } />
      { translate('INDEX.TOTAL') }  - ({ translate('INDEX.AMOUNT_SM') } - txfee): + ({ translate('INDEX.AMOUNT_SM') } - fee):   { Number(this.state.amount) - Number(this.state.fee) } { this.props.ActiveCoin.coin }
      @@ -282,7 +287,8 @@ export const SendCoinRender = function() {
      - { this.stateisCameraFeatureDetected && + { this.state.isCameraFeatureDetected &&
        - { translate('INDEX.MY') } { this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-' } { translate('INDEX.ADDRESS') }: - { this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-' } + { translate('INDEX.MY') } { this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-' } { translate('INDEX.ADDRESS') }: + { this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-' }
      + { this.props.ActiveCoin.mode === 'native' && + + }
      -
      +
      { this.state.error }
      diff --git a/react/src/components/dashboard/receiveCoin/receiveCoin.js b/react/src/components/dashboard/receiveCoin/receiveCoin.js index e440235..a3214fb 100644 --- a/react/src/components/dashboard/receiveCoin/receiveCoin.js +++ b/react/src/components/dashboard/receiveCoin/receiveCoin.js @@ -124,12 +124,14 @@ class ReceiveCoin extends React.Component { if (this.isBasiliskMode() && this.hasNoAmount(address)) { address.amount = _cache && _cache[_coin][address.address] && + _cache[_coin][address.address].getbalance && _cache[_coin][address.address].getbalance.data && _cache[_coin][address.address].getbalance.data.balance ? _cache[_coin][address.address].getbalance.data.balance : 'N/A'; } if (this.isBasiliskMode() && this.hasNoInterest(address)) { address.interest = _cache && _cache[_coin][address.address] && + _cache[_coin][address.address].getbalance && _cache[_coin][address.address].getbalance.data && _cache[_coin][address.address].getbalance.data.interest ? _cache[_coin][address.address].getbalance.data.interest : 'N/A'; } diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index 14a43f4..bf1fe94 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -55,7 +55,6 @@ class SendCoin extends React.Component { currentStackLength: 0, totalStackLength: 0, utxoMethodInProgress: false, - isCameraFeatureDetected: false, }; this.updateInput = this.updateInput.bind(this); this.handleBasiliskSend = this.handleBasiliskSend.bind(this); @@ -66,27 +65,9 @@ class SendCoin extends React.Component { this._fetchNewUTXOData = this._fetchNewUTXOData.bind(this); this.handleClickOutside = this.handleClickOutside.bind(this); this.setRecieverFromScan = this.setRecieverFromScan.bind(this); - this.detectCamera = this.detectCamera.bind(this); socket.on('messages', msg => this.updateSocketsData(msg)); } - // test device camera capabilities - detectCamera() { - const _getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; - - _getUserMedia( - { 'video': true }, - function() { - this.setState({ - isCameraFeatureDetected: true, - }); - }, - function() { - console.warn('this device doesn\'t have camera!'); - } - ); - } - setRecieverFromScan(receiver) { this.setState({ sendTo: receiver @@ -101,8 +82,6 @@ class SendCoin extends React.Component { this.handleClickOutside, false ); - - this.detectCamera(); } componentWillUnmount() { diff --git a/react/src/components/dashboard/sendCoin/sendCoin.render.js b/react/src/components/dashboard/sendCoin/sendCoin.render.js index b9749b4..43672d8 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.render.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.render.js @@ -163,13 +163,11 @@ export const SendApiTypeSelectorRender = function() {
      - { this.state.isCameraFeatureDetected && -
      - -
      - } +
      + +
      ); }; diff --git a/react/src/components/dashboard/walletsNav/walletsNav.render.js b/react/src/components/dashboard/walletsNav/walletsNav.render.js index ddb32e5..e16a91e 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.render.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.render.js @@ -41,7 +41,7 @@ export const WalletsNavWithWalletRender = function() { { this.props.ActiveCoin.mode === 'native' && @@ -60,7 +60,7 @@ export const WalletsNavWithWalletRender = function() { From eb5caa9ba6ac334482e4c032bbfd36af70d3649d Mon Sep 17 00:00:00 2001 From: pbca26 Date: Tue, 1 Aug 2017 19:38:18 +0300 Subject: [PATCH 18/30] added missing qr code scan in native send --- react/change.log | 1 + react/src/components/dashboard/sendCoin/sendCoin.js | 9 ++++----- .../dashboard/walletsNativeSend/walletsNativeSend.js | 9 +++++++++ .../walletsNativeSend/walletsNativeSend.render.js | 6 ++++++ react/src/components/overrides.scss | 6 ++++++ 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/react/change.log b/react/change.log index 37a0dae..65eee02 100644 --- a/react/change.log +++ b/react/change.log @@ -15,6 +15,7 @@ UI: - quick access dropdown on login to open settings / about / sync only modals - qr code generator / scan - basilisk send form reset fix +- added native wallet info button v0.2.0.21a-beta -------------- diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index bf1fe94..e80716e 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -1,9 +1,7 @@ import React from 'react'; import Config from '../../../config'; import { translate } from '../../../translate/translate'; -import { - checkTimestamp -} from '../../../util/time'; +import { checkTimestamp } from '../../../util/time'; import { edexGetTxIDList, edexRemoveTXID @@ -302,7 +300,7 @@ class SendCoin extends React.Component { ); } else { return ( - - { translate('SEND.SELECT_T_OR_Z_ADDR') } - + { translate('SEND.SELECT_T_OR_Z_ADDR') } ); } } @@ -326,7 +324,7 @@ class SendCoin extends React.Component {
      • - - { translate('SEND.SELECT_T_OR_Z_ADDR') } - + { translate('SEND.SELECT_T_OR_Z_ADDR') }
      • @@ -758,6 +756,7 @@ class SendCoin extends React.Component { return null; } + render() { if (this.props.ActiveCoin && this.props.ActiveCoin.send && diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index 67cc7fa..a8220bd 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -35,6 +35,7 @@ class WalletsNativeSend extends React.Component { this.getOAdress = this.getOAdress.bind(this); this.handleClickOutside = this.handleClickOutside.bind(this); this.checkZAddressCount = this.checkZAddressCount.bind(this); + this.setRecieverFromScan = this.setRecieverFromScan.bind(this); } componentWillMount() { @@ -57,6 +58,14 @@ class WalletsNativeSend extends React.Component { this.checkZAddressCount(); } + setRecieverFromScan(receiver) { + this.setState({ + sendTo: receiver + }); + + document.getElementById('kmdWalletSendTo').focus(); + } + handleClickOutside(e) { if (e.srcElement.className !== 'btn dropdown-toggle btn-info' && (e.srcElement.offsetParent && e.srcElement.offsetParent.className !== 'btn dropdown-toggle btn-info') && diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js index b6a0d27..3b44dc6 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js @@ -1,5 +1,6 @@ import React from 'react'; import { translate } from '../../../translate/translate'; +import QRModal from '../qrModal/qrModal'; export const AddressListRender = function() { return ( @@ -70,6 +71,11 @@ export const WalletsNativeSendRender = function() { { translate('INDEX.SEND') } { this.props.ActiveCoin.coin }
      +
      + +
      Date: Wed, 2 Aug 2017 07:55:24 +0300 Subject: [PATCH 19/30] rescanning last n blocks progress placeholder --- .../dashboard/walletsProgress/walletsProgress.js | 12 ++++++++---- react/src/translate/en.js | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index acb8cb7..deafa93 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -57,11 +57,11 @@ class WalletsProgress extends React.Component { if (_debugLogMulti[i].indexOf('progress=') > -1) { _debugLogLine = _debugLogMulti[i]; } - } + } } else { _debugLogLine = this.props.Settings.debugLog; } - + if (_debugLogLine) { const temp = _debugLogLine.split(' '); let currentBestChain; @@ -90,7 +90,7 @@ class WalletsProgress extends React.Component { this.props.Dashboard.progress.code === -28 && this.props.Settings.debugLog) { const _progress = this.parseActivatingBestChainProgress(); - + if (_progress && _progress[1]) { return SyncPercentageRender.call(this, _progress[1].toFixed(2)); @@ -189,12 +189,16 @@ class WalletsProgress extends React.Component { } else { if (currentProgress) { return ( - `: ${currentProgress}% (${ translate('INDEX.RESCAN_SM') })` + `: ${currentProgress.toFixed(2)}% (${ translate('INDEX.RESCAN_SM') })` ); } else { return null; } } + } else if (this.props.Settings.debugLog.indexOf('Rescanning last') > -1) { + return ( + `: ({ translate('INDEX.RESCANNING_LAST_BLOCKS') })` + ); } else if ( this.props.Settings.debugLog.indexOf('LoadExternalBlockFile:') > -1 || this.props.Settings.debugLog.indexOf('Reindexing block file') > -1 diff --git a/react/src/translate/en.js b/react/src/translate/en.js index 4d5937c..39e35f5 100644 --- a/react/src/translate/en.js +++ b/react/src/translate/en.js @@ -17,6 +17,7 @@ export const _lang = { 'NO_ACTIVE_COIN': 'No active coin', }, 'INDEX': { + 'RESCANNING_LAST_BLOCKS': 'Rescanning last blocks...', 'NO_DATA_AVAILABLE': 'No data available', 'LOADING': 'Loading', 'ACTIVATING_SM': 'activating', From cd89b254d5abbb53e78c7f5956bbb77da4dc62f9 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Wed, 2 Aug 2017 08:58:07 +0300 Subject: [PATCH 20/30] formatValue negative num fix; balance placeholders rounding fix --- .../walletsBalance/walletsBalance.js | 31 +++++++++++++--- .../walletsBalance/walletsBalance.render.js | 35 +++++-------------- react/src/util/formatValue.js | 13 ++++--- 3 files changed, 42 insertions(+), 37 deletions(-) diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.js b/react/src/components/dashboard/walletsBalance/walletsBalance.js index c0f79c5..72a4e43 100755 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.js @@ -70,14 +70,13 @@ class WalletsBalance extends React.Component { if (_mode === 'full') { _balance = this.props.ActiveCoin.balance || 0; - } else { + } else if (_mode === 'basilisk') { if (this.props.ActiveCoin.cache) { const _cache = this.props.ActiveCoin.cache; const _coin = this.props.ActiveCoin.coin; const _address = this.props.ActiveCoin.activeAddress; - if (type === 'main' && - _mode === 'basilisk' && + if (type === 'transparent' && _address && _cache[_coin] && _cache[_coin][_address] && @@ -88,7 +87,6 @@ class WalletsBalance extends React.Component { } if (type === 'interest' && - _mode === 'basilisk' && _address && _cache[_coin] && _cache[_coin][_address] && @@ -99,7 +97,6 @@ class WalletsBalance extends React.Component { } if (type === 'total' && - _mode === 'basilisk' && _address && _cache[_coin] && _cache[_coin][_address] && @@ -113,6 +110,30 @@ class WalletsBalance extends React.Component { _balance = _regBalance + _regInterest; } } + } else if (_mode === 'native') { + if (type === 'total' && + this.props.ActiveCoin.balance && + this.props.ActiveCoin.balance.total) { + _balance = this.props.ActiveCoin.balance.total; + } + + if (type === 'interest' && + this.props.Dashboard.progress && + this.props.Dashboard.progress.interest) { + _balance = this.props.Dashboard.progress.interest; + } + + if (type === 'private' && + this.props.ActiveCoin.balance && + this.props.ActiveCoin.balance.private) { + _balance = this.props.ActiveCoin.balance.private; + } + + if (type === 'transparent' && + this.props.ActiveCoin.balance && + this.props.ActiveCoin.balance.transparent) { + _balance = this.props.ActiveCoin.balance.transparent; + } } return _balance; diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js index e00db48..4d28a63 100644 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js @@ -37,14 +37,8 @@ const WalletsBalanceRender = function() {
      - { this.isNativeMode() ? - this.props.ActiveCoin.balance.transparent ? this.props.ActiveCoin.balance.transparent : '-' - : - - { Config.roundValues ? formatValue('round', this.renderBalance('main'), -6) : this.renderBalance('main') } { this.props.ActiveCoin.coin } - - } + title={ Config.roundValues ? formatValue('round', this.renderBalance('transparent'), -6) : this.renderBalance('transparent') }> + { Config.roundValues ? formatValue('round', this.renderBalance('transparent'), -6) : this.renderBalance('transparent') } { this.props.ActiveCoin.coin }
      @@ -63,8 +57,8 @@ const WalletsBalanceRender = function() {
      - { this.props.ActiveCoin.balance.private ? (Config.roundValues ? formatValue('round', this.props.ActiveCoin.balance.private, -6) : this.props.ActiveCoin.balance.private) : '-' } + title={ Config.roundValues ? formatValue('round', this.renderBalance('private'), -6) : this.renderBalance('private') }> + { Config.roundValues ? formatValue('round', this.renderBalance('private'), -6) : this.renderBalance('private') }
  • @@ -84,15 +78,8 @@ const WalletsBalanceRender = function() {
    - { this.isNativeMode() ? - this.props.Dashboard.progress - && this.props.Dashboard.progress.interest ? this.props.Dashboard.progress.interest : '-' - : - - { Config.roundValues ? formatValue('round', this.renderBalance('interest'), -6) : this.renderBalance('interest') } { this.props.ActiveCoin.coin } - - } + title={ Config.roundValues ? formatValue('round', this.renderBalance('interest'), -6) : this.renderBalance('interest') }> + { Config.roundValues ? formatValue('round', this.renderBalance('interest'), -6) : this.renderBalance('interest') }
    @@ -112,14 +99,8 @@ const WalletsBalanceRender = function() {
    - { this.isNativeMode() ? - this.props.ActiveCoin.balance.total ? this.props.ActiveCoin.balance.total : '-' - : - - { Config.roundValues ? formatValue('round', this.renderBalance('total'), -6) : this.renderBalance('total') } { this.props.ActiveCoin.coin } - - } + title={ Config.roundValues ? formatValue('round', this.renderBalance('total'), -6) : this.renderBalance('total') }> + { Config.roundValues ? formatValue('round', this.renderBalance('total'), -6) : this.renderBalance('total') }
    diff --git a/react/src/util/formatValue.js b/react/src/util/formatValue.js index f28b22e..c355e8f 100644 --- a/react/src/util/formatValue.js +++ b/react/src/util/formatValue.js @@ -1,5 +1,6 @@ // ref: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Math/round#Decimal_rounding export function formatValue(formatType, formatValue, formatExp) { + let _formatExp; /** * Decimal adjustment of a number. * @@ -31,19 +32,21 @@ export function formatValue(formatType, formatValue, formatExp) { return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)); } - if (formatValue >= 1) { - formatExp = -3; + if (Math.abs(Number(formatValue)) >= 1) { + _formatExp = -3; + } else { + _formatExp = formatExp; } switch (formatType) { case 'round': - return decimalAdjust('round', formatValue, formatExp); + return decimalAdjust('round', formatValue, _formatExp); break; case 'floor': - return decimalAdjust('floor', formatValue, formatExp); + return decimalAdjust('floor', formatValue, _formatExp); break; case 'ceil': - return decimalAdjust('ceil', formatValue, formatExp); + return decimalAdjust('ceil', formatValue, _formatExp); break; } } \ No newline at end of file From 558e210675206857bcffa9fac21e783228ee2acc Mon Sep 17 00:00:00 2001 From: pbca26 Date: Wed, 2 Aug 2017 15:06:06 +0300 Subject: [PATCH 21/30] minor native send transparent improvements --- .../walletsNativeSend/walletsNativeSend.js | 80 ++++++++++++++----- .../walletsNativeSend.render.js | 21 +++-- .../walletsProgress/walletsProgress.js | 3 +- 3 files changed, 73 insertions(+), 31 deletions(-) diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index a8220bd..d9a601e 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -36,6 +36,7 @@ class WalletsNativeSend extends React.Component { this.handleClickOutside = this.handleClickOutside.bind(this); this.checkZAddressCount = this.checkZAddressCount.bind(this); this.setRecieverFromScan = this.setRecieverFromScan.bind(this); + this.renderOPIDListCheck = this.renderOPIDListCheck.bind(this); } componentWillMount() { @@ -91,26 +92,46 @@ class WalletsNativeSend extends React.Component { } renderAddressByType(type) { + let _items = []; + if (this.props.ActiveCoin.addresses && this.props.ActiveCoin.addresses[type] && this.props.ActiveCoin.addresses[type].length) { - return this.props.ActiveCoin.addresses[type].map((address) => -
  • - this.updateAddressSelection(address.address, type, address.amount) }> -    - - [ { address.amount } { this.props.ActiveCoin.coin } ]   - { type === 'public' ? address.address : address.address.substring(0, 34) + '...' } - - - -
  • - ); + this.props.ActiveCoin.addresses[type].map((address) => { + if (address.amount > 0) { + _items.push( +
  • + this.updateAddressSelection(address.address, type, address.amount) }> +    + + [ { address.amount } { this.props.ActiveCoin.coin } ]   + { type === 'public' ? address.address : address.address.substring(0, 34) + '...' } + + + +
  • + ); + } + }); + + return _items; } else { return null; } } + renderOPIDListCheck() { + if (this.state.renderAddressDropdown && + this.props.ActiveCoin.opids && + this.props.ActiveCoin.opids.length) { + return true; + } + } + renderSelectorCurrentLabel() { if (this.state.sendFrom) { return ( @@ -118,13 +139,13 @@ class WalletsNativeSend extends React.Component { [ { this.state.sendFromAmount } { this.props.ActiveCoin.coin } ]   - { this.state.sendFrom } + { this.state.addressType === 'public' ? this.state.sendFrom : this.state.sendFrom.substring(0, 34) + '...' } ); } else { return ( - - { translate('SEND.SELECT_T_OR_Z_ADDR') } - + Transparent funds ); } } @@ -247,14 +268,29 @@ class WalletsNativeSend extends React.Component { this.state ) ); - setTimeout(() => { - Store.dispatch( - getKMDOPID( - null, - this.props.ActiveCoin.coin - ) - ); - }, 1000); + + if (this.state.addressType === 'private') { + setTimeout(() => { + Store.dispatch( + getKMDOPID( + null, + this.props.ActiveCoin.coin + ) + ); + }, 1000); + } + + this.setState({ + addressType: null, + sendFrom: null, + sendFromAmount: 0, + sendTo: '', + sendToOA: null, + amount: 0, + fee: 0, + addressSelectorOpen: false, + renderAddressDropdown: true, + }); } getOAdress() { diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js index 3b44dc6..fb9203f 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js @@ -17,9 +17,15 @@ export const AddressListRender = function() {
    @@ -116,6 +122,7 @@ export const WalletsNativeSendRender = function() { type="text" className="form-control" name="amount" + value={ this.state.amount !== 0 ? this.state.amount : '' } onChange={ this.updateInput } id="kmdWalletAmount" placeholder="0.000" @@ -134,7 +141,7 @@ export const WalletsNativeSendRender = function() { onChange={ this.updateInput } id="kmdWalletFee" placeholder="0.000" - value={ this.state.fee } + value={ this.state.fee !== 0 ? this.state.fee : '' } autoComplete="off" />
    @@ -149,7 +156,7 @@ export const WalletsNativeSendRender = function() { type="button" className="btn btn-primary waves-effect waves-light pull-right" onClick={ this.handleSubmit } - disabled={ (!this.state.sendFrom && this.state.renderAddressDropdown) || !this.state.sendTo || !this.state.amount }> + disabled={ !this.state.sendTo || !this.state.amount }> { translate('INDEX.SEND') } { this.state.amount } { this.props.ActiveCoin.coin }
    @@ -159,7 +166,7 @@ export const WalletsNativeSendRender = function() {
    - { this.state.renderAddressDropdown && + { this.renderOPIDListCheck() &&
    @@ -182,7 +189,7 @@ export const WalletsNativeSendRender = function() { { translate('INDEX.TIME') } { translate('INDEX.RESULT') } - + { this.renderOPIDList() } diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index deafa93..f6ea680 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -112,8 +112,7 @@ class WalletsProgress extends React.Component { if (this.props.Dashboard.progress && this.props.Dashboard.progress.blocks) { - const syncPercentage = (parseFloat(parseInt(this.props.Dashboard.progress.blocks, 10) * 100 - / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0); + const syncPercentage = (parseFloat(parseInt(this.props.Dashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0); return SyncPercentageRender.call(this, syncPercentage); } From feb5f5a01a35dbeb62e1fa25021868961842f01e Mon Sep 17 00:00:00 2001 From: pbca26 Date: Wed, 2 Aug 2017 16:40:00 +0300 Subject: [PATCH 22/30] hide send btn if zero balance --- .../walletsBalance/walletsBalance.render.js | 2 +- .../dashboard/walletsNav/walletsNav.js | 36 +++++++++++++++++++ .../dashboard/walletsNav/walletsNav.render.js | 14 ++++---- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js index 4d28a63..01a818b 100644 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js @@ -38,7 +38,7 @@ const WalletsBalanceRender = function() { - { Config.roundValues ? formatValue('round', this.renderBalance('transparent'), -6) : this.renderBalance('transparent') } { this.props.ActiveCoin.coin } + { Config.roundValues ? formatValue('round', this.renderBalance('transparent'), -6) : this.renderBalance('transparent') }
    diff --git a/react/src/components/dashboard/walletsNav/walletsNav.js b/react/src/components/dashboard/walletsNav/walletsNav.js index cfe7ddb..4b17767 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.js @@ -23,6 +23,7 @@ class WalletsNav extends React.Component { this.toggleSendReceiveCoinForms = this.toggleSendReceiveCoinForms.bind(this); this.toggleNativeWalletInfo = this.toggleNativeWalletInfo.bind(this); this.toggleNativeWalletTransactions = this.toggleNativeWalletTransactions.bind(this); + this.checkTotalBalance = this.checkTotalBalance.bind(this); } componentWillMount() { @@ -33,6 +34,41 @@ class WalletsNav extends React.Component { Store.dispatch(copyCoinAddress(address)); } + checkTotalBalance() { + let _balance = '0'; + const _mode = this.props.ActiveCoin.mode; + + if (_mode === 'full') { + _balance = this.props.ActiveCoin.balance || 0; + } else if (_mode === 'basilisk') { + if (this.props.ActiveCoin.cache) { + const _cache = this.props.ActiveCoin.cache; + const _coin = this.props.ActiveCoin.coin; + const _address = this.props.ActiveCoin.activeAddress; + + if (_address && + _cache[_coin] && + _cache[_coin][_address] && + _cache[_coin][_address].getbalance && + _cache[_coin][_address].getbalance.data && + (_cache[_coin][_address].getbalance.data.balance || + _cache[_coin][_address].getbalance.data.interest)) { + const _regBalance = _cache[_coin][_address].getbalance.data.balance ? _cache[_coin][_address].getbalance.data.balance : 0; + const _regInterest = _cache[_coin][_address].getbalance.data.interest ? _cache[_coin][_address].getbalance.data.interest : 0; + + _balance = _regBalance + _regInterest; + } + } + } else if (_mode === 'native') { + if (this.props.ActiveCoin.balance && + this.props.ActiveCoin.balance.total) { + _balance = this.props.ActiveCoin.balance.total; + } + } + + return _balance; + } + toggleSendReceiveCoinForms() { if (this.props.ActiveCoin.mode === 'native') { Store.dispatch( diff --git a/react/src/components/dashboard/walletsNav/walletsNav.render.js b/react/src/components/dashboard/walletsNav/walletsNav.render.js index e16a91e..67d43a7 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.render.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.render.js @@ -52,12 +52,14 @@ export const WalletsNavWithWalletRender = function() { onClick={ this.props.ActiveCoin.mode !== 'native' ? this.toggleSendReceiveCoinForms : this.toggleNativeWalletTransactions }> { translate('INDEX.TRANSACTIONS') } - + { this.checkTotalBalance() > 0 && + + }
    + title={ this.renderBalance('transparent') }> { Config.roundValues ? formatValue('round', this.renderBalance('transparent'), -6) : this.renderBalance('transparent') }
    @@ -57,7 +57,7 @@ const WalletsBalanceRender = function() {
    + title={ this.renderBalance('private') }> { Config.roundValues ? formatValue('round', this.renderBalance('private'), -6) : this.renderBalance('private') }
    @@ -78,7 +78,7 @@ const WalletsBalanceRender = function() {
    + title={ this.renderBalance('interest') }> { Config.roundValues ? formatValue('round', this.renderBalance('interest'), -6) : this.renderBalance('interest') }
    @@ -99,7 +99,7 @@ const WalletsBalanceRender = function() {
    + title={ this.renderBalance('total') }> { Config.roundValues ? formatValue('round', this.renderBalance('total'), -6) : this.renderBalance('total') }
    diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index b94e4e6..119a589 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -550,12 +550,20 @@ class WalletsData extends React.Component { if (_addresses.public[i].address === this.state.currentAddress) { if (_addresses.public[i].amount && _addresses.public[i].amount !== 'N/A') { - return _addresses.public[i].amount; + let _amount = _addresses.public[i].amount; + + if (_amount !== 'N/A') { + _amount = formatValue('round', _amount, -6); + } + + return _amount; } else { const address = _addresses.public[i].address; let _amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A'; - _amount = formatValue('round', _amount, -6); + if (_amount !== 'N/A') { + _amount = formatValue('round', _amount, -6); + } return _amount; } diff --git a/react/src/util/sort.js b/react/src/util/sort.js index 5904c6b..c559c4e 100644 --- a/react/src/util/sort.js +++ b/react/src/util/sort.js @@ -1,8 +1,7 @@ export function sortByDate(data) { return data.sort(function(a, b) { - if (a.confirmations && - b.confirmations) { - return a.confirmations - b.confirmations; + if (a.txid === b.txid) { + return 1; } else { return a.confirmations - b.confirmations; } From d34a436cafe628d6cb828a91759dab0cc49f9b4d Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 3 Aug 2017 12:46:11 +0300 Subject: [PATCH 27/30] basilisk tx history address selector check mark --- .../dashboard/walletsData/walletsData.js | 24 ++++++++++++------- .../walletsData/walletsData.render.js | 2 +- .../walletsTxInfo/walletsTxInfo.render.js | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index 119a589..74bdbb4 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -124,22 +124,24 @@ class WalletsData extends React.Component { } updateSocketsData(data) { + let stateObj = {}; + if (this.props.ActiveCoin.mode === 'basilisk') { if (data && data.message && data.message.shepherd.iguanaAPI && data.message.shepherd.iguanaAPI.totalStackLength) { - this.setState(Object.assign({}, this.state, { + stateObj = Object.assign(stateObj, { totalStackLength: data.message.shepherd.iguanaAPI.totalStackLength, - })); + }); } if (data && data.message && data.message.shepherd.iguanaAPI && data.message.shepherd.iguanaAPI.currentStackLength) { - this.setState(Object.assign({}, this.state, { + stateObj = Object.assign(stateObj, { currentStackLength: data.message.shepherd.iguanaAPI.currentStackLength, - })); + }); } if (data && data.message && @@ -148,6 +150,8 @@ class WalletsData extends React.Component { data.message.shepherd.status === 'done') { Store.dispatch(basiliskRefresh(false)); } + + this.setState(Object.assign({}, this.state, stateObj)); } } @@ -254,8 +258,8 @@ class WalletsData extends React.Component { if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.coin) { - if (!this.state.currentAddress && - this.props.ActiveCoin.activeAddress) { + if ((!this.state.currentAddress && this.props.ActiveCoin.activeAddress) || + (this.state.currentAddress !== this.props.ActiveCoin.activeAddress)) { stateObj = Object.assign(stateObj, { currentAddress: this.props.ActiveCoin.activeAddress, }); @@ -307,9 +311,9 @@ class WalletsData extends React.Component { itemsList: historyToSplit, }); } - } - this.setState(Object.assign({}, this.state, stateObj)); + this.setState(Object.assign({}, this.state, stateObj)); + } } updateCurrentPage(page) { @@ -518,7 +522,9 @@ class WalletsData extends React.Component { } items.push( -
  • +
  • this.updateAddressSelection(address, type, _amount) }>    [ { _amount } { _coin } ]  { address } diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index 13d77f3..c587b5e 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -131,7 +131,7 @@ export const AddressListRender = function() {
    diff --git a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js index 67fb416..4508d8c 100644 --- a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js +++ b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js @@ -51,7 +51,7 @@ const WalletsTxInfoRender = function(txInfo) { { translate('TX_INFO.ADDRESS') } - { txInfo.address } + { this.props.ActiveCoin.mode === 'basilisk' ? this.props.ActiveCoin.activeAddress : txInfo.address } From 17124c74fd4ecfdf94d56db79a717c97e53e532b Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 3 Aug 2017 17:09:03 +0300 Subject: [PATCH 28/30] skip walletTxInfo tabs render --- .../walletsTxInfo/walletsTxInfo.render.js | 217 +++++++++--------- 1 file changed, 112 insertions(+), 105 deletions(-) diff --git a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js index 4508d8c..96b142c 100644 --- a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js +++ b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js @@ -22,7 +22,7 @@ const WalletsTxInfoRender = function(txInfo) {
  • { this.isNativeMode() && -
  • +
  • this.openTab(1) }> Vjointsplits, Details @@ -30,7 +30,7 @@ const WalletsTxInfoRender = function(txInfo) { } { this.isNativeMode() && -
  • +
  • this.openTab(2) }> Hex @@ -45,117 +45,124 @@ const WalletsTxInfoRender = function(txInfo) {
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { this.isNativeMode() && + { this.state.activeTab === 0 && +
    +
    { translate('TX_INFO.ADDRESS') } - { this.props.ActiveCoin.mode === 'basilisk' ? this.props.ActiveCoin.activeAddress : txInfo.address } -
    { translate('TX_INFO.AMOUNT') } - { Config.roundValues ? formatValue('round', txInfo.amount, -10) : txInfo.amount } -
    { translate('TX_INFO.CATEGORY') } - { txInfo.category || txInfo.type } -
    { translate('TX_INFO.CONFIRMATIONS') } - { txInfo.confirmations } -
    blockhash - { txInfo.blockhash } -
    blocktime - { secondsToString(txInfo.blocktime || txInfo.timestamp) } -
    txid - { txInfo.txid } -
    + + + + + + + + + + + + + + + + + + { txInfo.blockhash && + + + + + } + { (txInfo.blocktime || txInfo.timestamp) && + + + + + } + + + + + { this.isNativeMode() && + + + + + } + { this.isNativeMode() && + + + + + } + { this.isNativeMode() && + + + + + } + +
    { translate('TX_INFO.ADDRESS') } + { this.props.ActiveCoin.mode === 'basilisk' ? this.props.ActiveCoin.activeAddress : txInfo.address } +
    { translate('TX_INFO.AMOUNT') } + { Config.roundValues ? formatValue('round', txInfo.amount, -10) : txInfo.amount } +
    { translate('TX_INFO.CATEGORY') } + { txInfo.category || txInfo.type } +
    { translate('TX_INFO.CONFIRMATIONS') } + { txInfo.confirmations } +
    blockhash + { txInfo.blockhash } +
    blocktime + { secondsToString(txInfo.blocktime || txInfo.timestamp) } +
    txid + { txInfo.txid } +
    walletconflicts + { txInfo.walletconflicts.length } +
    time + { secondsToString(txInfo.time) } +
    timereceived + { secondsToString(txInfo.timereceived) } +
    +
    + } + { this.state.activeTab === 1 && +
    + + - + - } - - { this.isNativeMode() && - + - } - - { this.isNativeMode() && - - - - - } - -
    walletconflictsvjoinsplit - { txInfo.walletconflicts.length } + { txInfo.vjoinsplit }
    timedetails - { secondsToString(txInfo.time) } + { txInfo.details }
    timereceived - { secondsToString(txInfo.timereceived) } -
    -
    - -
    - - - - - - - - - - - -
    vjoinsplit - { txInfo.vjoinsplit } -
    details - { txInfo.details } -
    -
    -
    - -
    - -
    - -
    + + +
    + } + { this.state.activeTab === 2 && +
    + +
    + } + { this.state.activeTab === 3 && +
    + +
    + }
  • From 27f05218224c5c808c555ea55ada405f0266fe97 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 4 Aug 2017 00:00:54 +0300 Subject: [PATCH 29/30] skip tx history re-render if data is the same --- .../dashboard/coinTile/coinTileItem.js | 19 ++--------- .../dashboard/walletsData/walletsData.js | 34 +++++++++++++++---- .../walletsProgress/walletsProgress.js | 4 +-- .../walletsTxInfo/walletsTxInfo.render.js | 3 -- react/src/util/sort.js | 7 ++-- 5 files changed, 35 insertions(+), 32 deletions(-) diff --git a/react/src/components/dashboard/coinTile/coinTileItem.js b/react/src/components/dashboard/coinTile/coinTileItem.js index cbf910b..bbf6c0b 100644 --- a/react/src/components/dashboard/coinTile/coinTileItem.js +++ b/react/src/components/dashboard/coinTile/coinTileItem.js @@ -25,10 +25,9 @@ import Config from '../../../config'; import CoinTileItemRender from './coinTileItem.render'; const BASILISK_CACHE_UPDATE_TIMEOUT = 240000; -const IGUNA_ACTIVE_HANDLE_TIMEOUT = 30000; -const IGUNA_ACTIVE_HANDLE_TIMEOUT_KMD_NATIVE = 30000; +const IGUNA_ACTIVE_HANDLE_TIMEOUT = 3000; +const IGUNA_ACTIVE_HANDLE_TIMEOUT_KMD_NATIVE = 15000; const NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD = 90; -let coinInitDataFetchInterval; class CoinTileItem extends React.Component { constructor(props) { @@ -108,20 +107,6 @@ class CoinTileItem extends React.Component { dashboardChangeActiveCoin(coin, mode) { if (coin !== this.props.ActiveCoin.coin) { - if (!this.props.ActiveCoin.coins[this.props.ActiveCoin.coin]) { - coinInitDataFetchInterval = setInterval(() => { - this.dispatchCoinActions(coin, mode); - - if ((mode === 'native' || mode === 'full') && this.props.Dashboard.progress) { - clearInterval(coinInitDataFetchInterval); - } - - if (mode === 'basilisk' && (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory !== 'loading') && this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] && JSON.parse(sessionStorage.getItem('IguanaActiveAccount'))[this.props.ActiveCoin.coin]) { - clearInterval(coinInitDataFetchInterval); - } - }, 500); - } - Store.dispatch( stopInterval( 'sync', diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index 74bdbb4..6919c08 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -49,6 +49,7 @@ class WalletsData extends React.Component { currentStackLength: 0, totalStackLength: 0, useCache: true, + coin: null, }; this.updateInput = this.updateInput.bind(this); this.toggleBasiliskActionsMenu = this.toggleBasiliskActionsMenu.bind(this); @@ -278,9 +279,16 @@ class WalletsData extends React.Component { this.state.activePage * this.state.itemsPerPage ); - stateObj = Object.assign(stateObj, { - itemsList: historyToSplit, - }); + if (!this.state.itemsList || (this.state.coin && this.state.coin !== this.props.ActiveCoin.coin) || (historyToSplit && + historyToSplit.length && + this.state.itemsList && + this.state.itemsList.length && + historyToSplit[0].txid !== this.state.itemsList[0].txid && + historyToSplit[historyToSplit.length - 1].txid !== this.state.itemsList[this.state.itemsList.length - 1].txid)) { + stateObj = Object.assign(stateObj, { + itemsList: historyToSplit, + }); + } } } @@ -307,12 +315,24 @@ class WalletsData extends React.Component { this.state.activePage * this.state.itemsPerPage ); - stateObj = Object.assign(stateObj, { - itemsList: historyToSplit, - }); + if (!this.state.itemsList || (this.state.coin && this.state.coin !== this.props.ActiveCoin.coin) || (historyToSplit && + historyToSplit.length && + this.state.itemsList && + this.state.itemsList.length && + historyToSplit[0].txid !== this.state.itemsList[0].txid && + historyToSplit[historyToSplit.length - 1].txid !== this.state.itemsList[this.state.itemsList.length - 1].txid)) { + stateObj = Object.assign(stateObj, { + itemsList: historyToSplit, + }); + } } - this.setState(Object.assign({}, this.state, stateObj)); + stateObj = Object.assign(stateObj, { + coin: this.props.ActiveCoin.coin, + }); + if (Object.keys(stateObj).length) { + this.setState(Object.assign({}, this.state, stateObj)); + } } } diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index f6ea680..32134c2 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -93,7 +93,7 @@ class WalletsProgress extends React.Component { if (_progress && _progress[1]) { - return SyncPercentageRender.call(this, _progress[1].toFixed(2)); + return SyncPercentageRender.call(this, _progress[1] === 1000 ? 100 : _progress[1].toFixed(2)); } else { return LoadingBlocksRender.call(this); } @@ -113,7 +113,7 @@ class WalletsProgress extends React.Component { if (this.props.Dashboard.progress && this.props.Dashboard.progress.blocks) { const syncPercentage = (parseFloat(parseInt(this.props.Dashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0); - return SyncPercentageRender.call(this, syncPercentage); + return SyncPercentageRender.call(this, syncPercentage === 1000 ? 100 : syncPercentage); } return LoadingBlocksRender.call(this); diff --git a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js index 96b142c..8afdd80 100644 --- a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js +++ b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js @@ -20,7 +20,6 @@ const WalletsTxInfoRender = function(txInfo) { TxID Info - { this.isNativeMode() &&
  • this.openTab(1) }> @@ -28,7 +27,6 @@ const WalletsTxInfoRender = function(txInfo) {
  • } - { this.isNativeMode() &&
  • this.openTab(2) }> @@ -36,7 +34,6 @@ const WalletsTxInfoRender = function(txInfo) {
  • } -
  • this.openTab(3) }> Raw info diff --git a/react/src/util/sort.js b/react/src/util/sort.js index c559c4e..d7cf9d2 100644 --- a/react/src/util/sort.js +++ b/react/src/util/sort.js @@ -1,9 +1,10 @@ export function sortByDate(data) { return data.sort(function(a, b) { - if (a.txid === b.txid) { - return 1; - } else { + if (a.confirmations && + b.confirmations) { return a.confirmations - b.confirmations; + } else { + return 1; } }); } \ No newline at end of file From 98ce521140397ea88cfae0820bfa5418392f46c3 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 4 Aug 2017 07:18:11 +0300 Subject: [PATCH 30/30] trigger coin store fetch to load data --- react/src/components/dashboard/coinTile/coinTileItem.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/react/src/components/dashboard/coinTile/coinTileItem.js b/react/src/components/dashboard/coinTile/coinTileItem.js index bbf6c0b..62776bb 100644 --- a/react/src/components/dashboard/coinTile/coinTileItem.js +++ b/react/src/components/dashboard/coinTile/coinTileItem.js @@ -107,6 +107,9 @@ class CoinTileItem extends React.Component { dashboardChangeActiveCoin(coin, mode) { if (coin !== this.props.ActiveCoin.coin) { + Store.dispatch(dashboardChangeActiveCoin(coin, mode)); + this.dispatchCoinActions(coin, mode); // triggers fetch coin data from store if available + Store.dispatch( stopInterval( 'sync', @@ -121,8 +124,6 @@ class CoinTileItem extends React.Component { ) ); - Store.dispatch(dashboardChangeActiveCoin(coin, mode)); - if (mode === 'full') { const _iguanaActiveHandle = setInterval(() => { this.dispatchCoinActions(coin, mode);