From 5e01a6d1bca6397a8d17ba25a1eafe426e532753 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 20 Jul 2017 10:14:34 -0700 Subject: [PATCH 01/22] activating best chain progress fix --- react/src/actions/actions/nativeSyncInfo.js | 12 +++- .../walletsProgress/walletsProgress.js | 58 ++++++++++++++++++- 2 files changed, 64 insertions(+), 6 deletions(-) diff --git a/react/src/actions/actions/nativeSyncInfo.js b/react/src/actions/actions/nativeSyncInfo.js index 2bbf5a9..b351e7b 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -63,7 +63,8 @@ export function getSyncInfoNativeKMD(skipDebug) { function getSyncInfoNativeState(json, coin, skipDebug) { if (coin === 'KMD' && json && - json.error) { + json.error && + json.error.message.indexOf('Activating best') === -1) { return getSyncInfoNativeKMD(skipDebug); } else { if (json && @@ -71,12 +72,12 @@ function getSyncInfoNativeState(json, coin, skipDebug) { Config.cli.default) { return { type: SYNCING_NATIVE_MODE, - progress: Config.cli.default ? json.error : json, + progress: json.error, } } else { return { type: SYNCING_NATIVE_MODE, - progress: Config.cli.default ? json.result : json, + progress: json.result ? json.result : json, } } } @@ -163,6 +164,11 @@ export function getSyncInfoNative(coin, skipDebug) { json = JSON.parse(json); } + if (json.error && + json.error.message.indexOf('Activating best') === -1) { + dispatch(getDebugLog('komodo', 1)); + } + dispatch(logGuiHttp({ 'timestamp': _timestamp, 'status': 'success', diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index af97464..b63c2a2 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -47,7 +47,49 @@ class WalletsProgress extends React.Component { } } + parseActivatingBestChainProgress() { + let _debugLogLine; + + if (this.props.Settings.debugLog.indexOf('\n') > -1) { + const _debugLogMulti = this.props.Settings.debugLog.split('\n'); + + for (let i = 0; i < _debugLogMulti.length; i++) { + if (_debugLogMulti[i].indexOf('progress=') > -1) { + _debugLogLine = _debugLogMulti[i]; + } + } + } else { + _debugLogLine = this.props.Settings.debugLog; + } + + const temp = _debugLogLine.split(' '); + let currentBestChain; + let currentProgress; + + for (let i = 0; i < temp.length; i++) { + if (temp[i].indexOf('height=') > -1) { + currentBestChain = temp[i].replace('height=', ''); + } + if (temp[i].indexOf('progress=') > -1) { + currentProgress = Number(temp[i].replace('progress=', '')) * 1000; + } + } + + return [ + currentBestChain, + currentProgress + ]; + } + renderSyncPercentagePlaceholder() { + // activating best chain + if (this.props.Dashboard.progress && + this.props.Dashboard.progress.code && + this.props.Dashboard.progress.code === -28 && + this.props.Settings.debugLog) { + return SyncPercentageRender.call(this, this.parseActivatingBestChainProgress()[1].toFixed(2)); + } + if (this.props.Dashboard.progress && this.props.Dashboard.progress.blocks > 0 && this.props.Dashboard.progress.longestchain === 0) { @@ -120,9 +162,19 @@ class WalletsProgress extends React.Component { } } - return ( - `: ${currentProgress}% (${ translate('INDEX.RESCAN_SM') })` - ); + // activating best chain + if (this.props.Dashboard.progress && + this.props.Dashboard.progress.code && + this.props.Dashboard.progress.code === -28 && + this.props.Settings.debugLog) { + return ( + `: ${this.parseActivatingBestChainProgress()[0]} (current block)` + ); + } else { + return ( + `: ${currentProgress}% (${ translate('INDEX.RESCAN_SM') })` + ); + } } else if ( this.props.Settings.debugLog.indexOf('LoadExternalBlockFile:') > -1 || this.props.Settings.debugLog.indexOf('Reindexing block file') > -1 From 78bfe94f4984966dffc5591a9f6889d6afc67b61 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 21 Jul 2017 04:09:55 -0700 Subject: [PATCH 02/22] kmd native progress placeholder fix --- .../dashboard/walletsProgress/walletsProgress.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index b63c2a2..6029230 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -171,9 +171,13 @@ class WalletsProgress extends React.Component { `: ${this.parseActivatingBestChainProgress()[0]} (current block)` ); } else { - return ( - `: ${currentProgress}% (${ translate('INDEX.RESCAN_SM') })` - ); + if (currentProgress) { + return ( + `: ${currentProgress}% (${ translate('INDEX.RESCAN_SM') })` + ); + } else { + return null; + } } } else if ( this.props.Settings.debugLog.indexOf('LoadExternalBlockFile:') > -1 || From cea040a99b7d39945e16cb4da2e13decd796ff5e Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 21 Jul 2017 11:23:46 -0700 Subject: [PATCH 03/22] kmd native progress fix 2 --- .../walletsProgress/walletsProgress.js | 54 ++++++++++++------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index 6029230..acb8cb7 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -62,23 +62,25 @@ class WalletsProgress extends React.Component { _debugLogLine = this.props.Settings.debugLog; } - const temp = _debugLogLine.split(' '); - let currentBestChain; - let currentProgress; - - for (let i = 0; i < temp.length; i++) { - if (temp[i].indexOf('height=') > -1) { - currentBestChain = temp[i].replace('height=', ''); - } - if (temp[i].indexOf('progress=') > -1) { - currentProgress = Number(temp[i].replace('progress=', '')) * 1000; + if (_debugLogLine) { + const temp = _debugLogLine.split(' '); + let currentBestChain; + let currentProgress; + + for (let i = 0; i < temp.length; i++) { + if (temp[i].indexOf('height=') > -1) { + currentBestChain = temp[i].replace('height=', ''); + } + if (temp[i].indexOf('progress=') > -1) { + currentProgress = Number(temp[i].replace('progress=', '')) * 1000; + } } - } - return [ - currentBestChain, - currentProgress - ]; + return [ + currentBestChain, + currentProgress + ]; + } } renderSyncPercentagePlaceholder() { @@ -87,7 +89,14 @@ class WalletsProgress extends React.Component { this.props.Dashboard.progress.code && this.props.Dashboard.progress.code === -28 && this.props.Settings.debugLog) { - return SyncPercentageRender.call(this, this.parseActivatingBestChainProgress()[1].toFixed(2)); + const _progress = this.parseActivatingBestChainProgress(); + + if (_progress && + _progress[1]) { + return SyncPercentageRender.call(this, _progress[1].toFixed(2)); + } else { + return LoadingBlocksRender.call(this); + } } if (this.props.Dashboard.progress && @@ -167,9 +176,16 @@ class WalletsProgress extends React.Component { this.props.Dashboard.progress.code && this.props.Dashboard.progress.code === -28 && this.props.Settings.debugLog) { - return ( - `: ${this.parseActivatingBestChainProgress()[0]} (current block)` - ); + const _blocks = this.parseActivatingBestChainProgress(); + + if (_blocks && + _blocks[0]) { + return ( + `: ${_blocks[0]} (current block)` + ); + } else { + return null; + } } else { if (currentProgress) { return ( From fe49ab3525d73d88b6d2d7a3642bd9bf1f54ac8f Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 21 Jul 2017 11:59:35 -0700 Subject: [PATCH 04/22] minor cli fix --- react/src/components/dashboard/settings/settings.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 3d3a7a8..7e18e49 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -480,7 +480,7 @@ class Settings extends React.Component { let _cliResponseParsed; try { - _cliResponseParsed = JSON.parse(_cliResponse.result); + _cliResponseParsed = JSON.parse(_cliResponse); } catch(e) { _cliResponseParsed = _cliResponse.result; } @@ -502,9 +502,14 @@ class Settings extends React.Component { __cliResponseParsed = _cliResponseParsed; } + if (!__cliResponseParsed) { + __cliResponseParsed = _cliResponseParsed; + } + let _items = []; - if (__cliResponseParsed.length && + if (__cliResponseParsed && + __cliResponseParsed.length && __cliResponseParsed !== 'wrong cli string format') { for (let i = 0; i < __cliResponseParsed.length; i++) { _items.push( @@ -512,11 +517,11 @@ class Settings extends React.Component { ); } } else { - if (typeof _cliResponseParsed === 'object') { + if (typeof __cliResponseParsed === 'object') { _items.push(
{ JSON.stringify(__cliResponseParsed, null, '\t') }
); - } else if (typeof _cliResponseParsed === 'string' || typeof _cliResponseParsed === 'number' || _cliResponseParsed === 'wrong cli string format') { + } else if (typeof __cliResponseParsed === 'string' || typeof __cliResponseParsed === 'number' || __cliResponseParsed === 'wrong cli string format') { _items.push(
{ __cliResponseParsed }
); From 7cd16e1666abc8e924ad9e08b06bf9ad97c6f04c Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 22 Jul 2017 07:03:57 -0700 Subject: [PATCH 05/22] cli temp --- .../components/dashboard/settings/settings.js | 131 ++++++++++++++++-- 1 file changed, 119 insertions(+), 12 deletions(-) diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 7e18e49..9ee9613 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -473,19 +473,131 @@ class Settings extends React.Component { ); } +/* + if (_cliResponse) { + let _cliResponseParsed; + let __cliResponseParsed; + let errorObj = { + code: null, + message: null, + }; + + if (_cliResponse.result.indexOf('"code":')) { + errorObj.code = _cliResponse.result.match(/"code":(.*?),/i)[1]; + errorObj.message = _cliResponse.result.substr(_cliResponse.result.indexOf('"message":') + 11, _cliResponse.result.length - _cliResponse.result.indexOf('"message":') - 15); + if (errorObj.message.indexOf('\n') > -1) { + errorObj.message.replace('\n', '----'); + } + console.log(errorObj.message.toString().match(/\n/g)); + } + + // console.log(errorObj); + if (errorObj.code && + errorObj.message) { + _cliResponseParsed = 'error code: '+ errorObj.code + ' message: ' + errorObj.message; + if (_cliResponseParsed.indexOf('\n') > -1) { + __cliResponseParsed = _cliResponseParsed.split('\n'); + console.log(__cliResponseParsed); + } + if (_cliResponseParsed.indexOf('\r\n') > -1) { + __cliResponseParsed = _cliResponseParsed.split('\r\n'); + console.log(__cliResponseParsed); + } + } else { + try { + _cliResponseParsed = JSON.parse(_cliResponse); + } catch(e) { + _cliResponseParsed = _cliResponse.result; + } + } + + if (!__cliResponseParsed) { + if (typeof _cliResponseParsed !== 'object' && + typeof _cliResponseParsed !== 'number' && + _cliResponseParsed !== 'wrong cli string format' && + _cliResponseParsed.indexOf('\r\n') > -1) { + _cliResponseParsed = _cliResponseParsed.split('\r\n') ; + } else if ( + typeof _cliResponseParsed !== 'object' && + typeof _cliResponseParsed !== 'number' && + _cliResponseParsed !== 'wrong cli string format' && + _cliResponseParsed.indexOf('\n') > -1 + ) { + __cliResponseParsed = _cliResponseParsed.split('\n'); + } else { + __cliResponseParsed = _cliResponseParsed; + } + } + + let _items = []; + + if (__cliResponseParsed && + __cliResponseParsed.length && + __cliResponseParsed !== 'wrong cli string format') { + for (let i = 0; i < __cliResponseParsed.length; i++) { + _items.push( +
{ typeof __cliResponseParsed[i] === 'object' ? JSON.stringify(__cliResponseParsed[i], null, '\t') : __cliResponseParsed[i] }
+ ); + } + } else { + if (typeof __cliResponseParsed === 'object') { + _items.push( +
{ JSON.stringify(__cliResponseParsed, null, '\t') }
+ ); + } else if (typeof __cliResponseParsed === 'string' || typeof __cliResponseParsed === 'number' || __cliResponseParsed === 'wrong cli string format') { + _items.push( +
{ __cliResponseParsed }
+ ); + } else { + _items.push( +
{ translate('INDEX.NO_DATA_AVAILABLE') }
+ ); + } + } + + return ( +
+
+ CLI response: +
+ { _items } +
+ ); + } else { + return null; + } +*/ + renderCliResponse() { const _cliResponse = this.props.Settings.cli; + let _items = []; if (_cliResponse) { let _cliResponseParsed; try { - _cliResponseParsed = JSON.parse(_cliResponse); + _cliResponseParsed = JSON.parse(_cliResponse.result); } catch(e) { _cliResponseParsed = _cliResponse.result; } - let __cliResponseParsed; + if (Object.prototype.toString.call(_cliResponseParsed) === '[object Array]') { + for (let i = 0; i < _cliResponseParsed.length; i++) { + _items.push( +
{ _cliResponseParsed[i] }
+ ); + } + } + if (_cliResponseParsed.indexOf('\n') > -1) { + _cliResponseParsed = _cliResponseParsed.split('\n'); + console.log( _cliResponseParsed.split('\n')); + for (let i = 0; i < _cliResponseParsed.length; i++) { + _items.push( +
{ _cliResponseParsed[i] }
+ ); + } + } + /*let __cliResponseParsed; if (typeof _cliResponseParsed !== 'object' && typeof _cliResponseParsed !== 'number' && _cliResponseParsed !== 'wrong cli string format' && @@ -502,14 +614,9 @@ class Settings extends React.Component { __cliResponseParsed = _cliResponseParsed; } - if (!__cliResponseParsed) { - __cliResponseParsed = _cliResponseParsed; - } - let _items = []; - if (__cliResponseParsed && - __cliResponseParsed.length && + if (__cliResponseParsed.length && __cliResponseParsed !== 'wrong cli string format') { for (let i = 0; i < __cliResponseParsed.length; i++) { _items.push( @@ -517,11 +624,11 @@ class Settings extends React.Component { ); } } else { - if (typeof __cliResponseParsed === 'object') { + if (typeof _cliResponseParsed === 'object') { _items.push(
{ JSON.stringify(__cliResponseParsed, null, '\t') }
); - } else if (typeof __cliResponseParsed === 'string' || typeof __cliResponseParsed === 'number' || __cliResponseParsed === 'wrong cli string format') { + } else if (typeof _cliResponseParsed === 'string' || typeof _cliResponseParsed === 'number' || _cliResponseParsed === 'wrong cli string format') { _items.push(
{ __cliResponseParsed }
); @@ -529,8 +636,8 @@ class Settings extends React.Component { _items.push(
{ translate('INDEX.NO_DATA_AVAILABLE') }
); - } - } + }*/ + //} return (
From 76c2fa36d7031f4e41d960c1de5a1bccec205983 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 22 Jul 2017 07:46:46 -0700 Subject: [PATCH 06/22] agama-start-fix --- assets/mainWindow/css/loading.css | 4 ++++ assets/mainWindow/js/loading.js | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/assets/mainWindow/css/loading.css b/assets/mainWindow/css/loading.css index f25764a..c8c97c3 100644 --- a/assets/mainWindow/css/loading.css +++ b/assets/mainWindow/css/loading.css @@ -105,4 +105,8 @@ body.agamaMode { .btn:last-child { margin-left: 20px; +} + +.btn.btn-primary.btn-close-app { + margin: 0; } \ No newline at end of file diff --git a/assets/mainWindow/js/loading.js b/assets/mainWindow/js/loading.js index 445e078..0620761 100644 --- a/assets/mainWindow/js/loading.js +++ b/assets/mainWindow/js/loading.js @@ -6,6 +6,13 @@ window.hide(); } + function quitApp() { + const remote = require('electron').remote; + const window = remote.getCurrentWindow(); + + window.forseCloseApp(); + } + function normalStart() { const remote = require('electron').remote; let appConf = remote.getCurrentWindow().appConfig; From e265a83d558ddd32226f2408cb29997e98cdabda Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 22 Jul 2017 22:59:17 +0300 Subject: [PATCH 07/22] refactored cli response parse method --- .../components/dashboard/settings/settings.js | 167 +++--------------- 1 file changed, 28 insertions(+), 139 deletions(-) diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 9ee9613..2c82d39 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -473,107 +473,14 @@ class Settings extends React.Component { ); } -/* - if (_cliResponse) { - let _cliResponseParsed; - let __cliResponseParsed; - let errorObj = { - code: null, - message: null, - }; - - if (_cliResponse.result.indexOf('"code":')) { - errorObj.code = _cliResponse.result.match(/"code":(.*?),/i)[1]; - errorObj.message = _cliResponse.result.substr(_cliResponse.result.indexOf('"message":') + 11, _cliResponse.result.length - _cliResponse.result.indexOf('"message":') - 15); - if (errorObj.message.indexOf('\n') > -1) { - errorObj.message.replace('\n', '----'); - } - console.log(errorObj.message.toString().match(/\n/g)); - } - - // console.log(errorObj); - if (errorObj.code && - errorObj.message) { - _cliResponseParsed = 'error code: '+ errorObj.code + ' message: ' + errorObj.message; - if (_cliResponseParsed.indexOf('\n') > -1) { - __cliResponseParsed = _cliResponseParsed.split('\n'); - console.log(__cliResponseParsed); - } - if (_cliResponseParsed.indexOf('\r\n') > -1) { - __cliResponseParsed = _cliResponseParsed.split('\r\n'); - console.log(__cliResponseParsed); - } - } else { - try { - _cliResponseParsed = JSON.parse(_cliResponse); - } catch(e) { - _cliResponseParsed = _cliResponse.result; - } - } - - if (!__cliResponseParsed) { - if (typeof _cliResponseParsed !== 'object' && - typeof _cliResponseParsed !== 'number' && - _cliResponseParsed !== 'wrong cli string format' && - _cliResponseParsed.indexOf('\r\n') > -1) { - _cliResponseParsed = _cliResponseParsed.split('\r\n') ; - } else if ( - typeof _cliResponseParsed !== 'object' && - typeof _cliResponseParsed !== 'number' && - _cliResponseParsed !== 'wrong cli string format' && - _cliResponseParsed.indexOf('\n') > -1 - ) { - __cliResponseParsed = _cliResponseParsed.split('\n'); - } else { - __cliResponseParsed = _cliResponseParsed; - } - } - - let _items = []; - - if (__cliResponseParsed && - __cliResponseParsed.length && - __cliResponseParsed !== 'wrong cli string format') { - for (let i = 0; i < __cliResponseParsed.length; i++) { - _items.push( -
{ typeof __cliResponseParsed[i] === 'object' ? JSON.stringify(__cliResponseParsed[i], null, '\t') : __cliResponseParsed[i] }
- ); - } - } else { - if (typeof __cliResponseParsed === 'object') { - _items.push( -
{ JSON.stringify(__cliResponseParsed, null, '\t') }
- ); - } else if (typeof __cliResponseParsed === 'string' || typeof __cliResponseParsed === 'number' || __cliResponseParsed === 'wrong cli string format') { - _items.push( -
{ __cliResponseParsed }
- ); - } else { - _items.push( -
{ translate('INDEX.NO_DATA_AVAILABLE') }
- ); - } - } - - return ( -
-
- CLI response: -
- { _items } -
- ); - } else { - return null; - } -*/ - + // TODO: rerender only if prop is changed renderCliResponse() { const _cliResponse = this.props.Settings.cli; let _items = []; if (_cliResponse) { let _cliResponseParsed; + let responseType; try { _cliResponseParsed = JSON.parse(_cliResponse.result); @@ -582,62 +489,44 @@ class Settings extends React.Component { } if (Object.prototype.toString.call(_cliResponseParsed) === '[object Array]') { + responseType = 'array'; + for (let i = 0; i < _cliResponseParsed.length; i++) { _items.push( -
{ _cliResponseParsed[i] }
+
{ JSON.stringify(_cliResponseParsed[i], null, '\t') }
); } } - if (_cliResponseParsed.indexOf('\n') > -1) { - _cliResponseParsed = _cliResponseParsed.split('\n'); - console.log( _cliResponseParsed.split('\n')); - for (let i = 0; i < _cliResponseParsed.length; i++) { - _items.push( -
{ _cliResponseParsed[i] }
- ); - } + if (Object.prototype.toString.call(_cliResponseParsed) === '[object]' || + typeof _cliResponseParsed === 'object') { + responseType = 'object'; + + _items.push( +
{ JSON.stringify(_cliResponseParsed, null, '\t') }
+ ); } - /*let __cliResponseParsed; - if (typeof _cliResponseParsed !== 'object' && - typeof _cliResponseParsed !== 'number' && - _cliResponseParsed !== 'wrong cli string format' && - _cliResponseParsed.indexOf('\r\n') > -1) { - _cliResponseParsed = _cliResponseParsed.split('\r\n') ; - } else if ( - typeof _cliResponseParsed !== 'object' && - typeof _cliResponseParsed !== 'number' && - _cliResponseParsed !== 'wrong cli string format' && - _cliResponseParsed.indexOf('\n') > -1 - ) { - __cliResponseParsed = _cliResponseParsed.split('\n') ; - } else { - __cliResponseParsed = _cliResponseParsed; + if (Object.prototype.toString.call(_cliResponseParsed) === 'number' || + typeof _cliResponseParsed === 'boolean' || + _cliResponseParsed === 'wrong cli string format') { + responseType = 'number'; + + _items.push( +
{ _cliResponseParsed.toString() }
+ ); } - let _items = []; + if (responseType !== 'number' && + responseType !== 'array' && + responseType !== 'object' && + _cliResponseParsed.indexOf('\n') > -1) { + _cliResponseParsed = _cliResponseParsed.split('\n'); - if (__cliResponseParsed.length && - __cliResponseParsed !== 'wrong cli string format') { - for (let i = 0; i < __cliResponseParsed.length; i++) { + for (let i = 0; i < _cliResponseParsed.length; i++) { _items.push( -
{ typeof __cliResponseParsed[i] === 'object' ? JSON.stringify(__cliResponseParsed[i], null, '\t') : __cliResponseParsed[i] }
+
{ _cliResponseParsed[i] }
); } - } else { - if (typeof _cliResponseParsed === 'object') { - _items.push( -
{ JSON.stringify(__cliResponseParsed, null, '\t') }
- ); - } else if (typeof _cliResponseParsed === 'string' || typeof _cliResponseParsed === 'number' || _cliResponseParsed === 'wrong cli string format') { - _items.push( -
{ __cliResponseParsed }
- ); - } else { - _items.push( -
{ translate('INDEX.NO_DATA_AVAILABLE') }
- ); - }*/ - //} + } return (
From 52d5bdf9e402d0e4664c34aa9c414fffaf7614fd Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 24 Jul 2017 00:28:38 -0700 Subject: [PATCH 08/22] basilisk progress bar css fix --- react/src/components/overrides.scss | 46 +++++++++++++++++++---------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/react/src/components/overrides.scss b/react/src/components/overrides.scss index 5f7bbe8..48ba422 100644 --- a/react/src/components/overrides.scss +++ b/react/src/components/overrides.scss @@ -40,12 +40,15 @@ body { .panel-title { cursor: pointer; cursor: hand; - } - .panel-title:before { - content: '\F273'; - } - .panel-title.collapsed:before { - content: '\F278'; + + &:before { + content: '\F273'; + } + &.collapsed { + &:before { + content: '\F278'; + } + } } } @@ -145,9 +148,10 @@ body { .display-sync-only-coins-toggle { cursor: pointer; -} -.display-sync-only-coins-toggle:hover { - color: #ffa726; + + &:hover { + color: #ffa726; + } } .btn-add-coin-item, @@ -197,12 +201,16 @@ body { margin-right: 8%; padding: 0; - .input.to-labelauty+label { - max-width: 136px; + .input{ + &.to-labelauty+label { + max-width: 136px; + } } } - .col-lg-4:last-child { - margin-right: 0; + .col-lg-4 { + &:last-child { + margin-right: 0; + } } .col-sm-1 { width: 44px; @@ -244,8 +252,10 @@ body { width: 80%; margin: 0 auto; } - .padding-bottom-60:last-child { - padding-bottom: 0 !important; + .padding-bottom-60 { + &:last-child { + padding-bottom: 0 !important; + } } } @@ -592,4 +602,10 @@ select{ .navbar-brand { padding: 22px 15px; +} + +.panel-actions { + .progress { + width: inherit; + } } \ No newline at end of file From bdccb6d912e874bc9da83908f5029410247708a1 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 24 Jul 2017 05:14:06 -0700 Subject: [PATCH 09/22] proper logout --- react/src/actions/actions/logout.js | 14 ++++++++++++-- react/src/actions/storeType.js | 3 ++- react/src/components/dashboard/navbar/navbar.js | 1 + .../src/components/dashboard/sendCoin/sendCoin.js | 3 ++- .../dashboard/walletsData/walletsData.js | 9 +++++++-- react/src/reducers/index.js | 12 +++++++++++- 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/react/src/actions/actions/logout.js b/react/src/actions/actions/logout.js index 933c869..428f5b8 100644 --- a/react/src/actions/actions/logout.js +++ b/react/src/actions/actions/logout.js @@ -1,4 +1,7 @@ -import { LOGIN } from '../storeType'; +import { + LOGIN, + LOGOUT +} from '../storeType'; import { triggerToaster, Config @@ -8,7 +11,7 @@ import { guiLogState } from './log'; -function logoutState(json, dispatch) { +function logoutState(json) { sessionStorage.removeItem('IguanaActiveAccount'); return { @@ -17,6 +20,12 @@ function logoutState(json, dispatch) { } } +function logoutResetAppState() { + return { + type: LOGOUT, + } +} + export function logout() { return dispatch => { dispatch(walletLock()); @@ -68,6 +77,7 @@ function walletLock() { 'response': json, })); dispatch(logoutState(json)); + dispatch(logoutResetAppState()); }) } } \ No newline at end of file diff --git a/react/src/actions/storeType.js b/react/src/actions/storeType.js index 1b0527e..e38874a 100644 --- a/react/src/actions/storeType.js +++ b/react/src/actions/storeType.js @@ -42,4 +42,5 @@ export const SERVICE_ERROR = 'SERVICE_ERROR'; export const DASHBOARD_ACTIVE_ADDRESS = 'DASHBOARD_ACTIVE_ADDRESS'; export const LOAD_APP_INFO = 'LOAD_APP_INFO'; export const LOG_GUI_HTTP = 'LOG_GUI_HTTP'; -export const CLI = 'CLI'; \ No newline at end of file +export const CLI = 'CLI'; +export const LOGOUT = 'LOGOUT'; \ No newline at end of file diff --git a/react/src/components/dashboard/navbar/navbar.js b/react/src/components/dashboard/navbar/navbar.js index e6b44b2..a8b2132 100755 --- a/react/src/components/dashboard/navbar/navbar.js +++ b/react/src/components/dashboard/navbar/navbar.js @@ -81,6 +81,7 @@ class Navbar extends React.Component { ) ); Store.dispatch(logout()); + location.reload(); } openSyncOnlyModal() { diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index 4436cc5..b07f438 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -94,7 +94,8 @@ class SendCoin extends React.Component { } componentWillReceiveProps(props) { - if (!this.state.sendFrom && + if (this.state && + !this.state.sendFrom && this.props.ActiveCoin.activeAddress) { this.setState(Object.assign({}, this.state, { sendFrom: this.props.ActiveCoin.activeAddress, diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index ce87f61..71a72b5 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -351,16 +351,21 @@ class WalletsData extends React.Component { } } + // TODO: add basilisk first run check, display no data if second run renderTxHistoryList() { if (this.state.itemsList === 'loading') { if (!this.isNativeMode() || this.isFullySynced()) { return ( -
{ translate('INDEX.LOADING_HISTORY') }...
+ + { translate('INDEX.LOADING_HISTORY') }... + ); } } else if (this.state.itemsList === 'no data') { return ( -
{ translate('INDEX.NO_DATA') }
+ + { translate('INDEX.NO_DATA') } + ); } else { if (this.state.itemsList && diff --git a/react/src/reducers/index.js b/react/src/reducers/index.js index a13cccb..2f20cd1 100644 --- a/react/src/reducers/index.js +++ b/react/src/reducers/index.js @@ -12,7 +12,7 @@ import { Interval } from './interval'; import { SyncOnly } from './syncOnly'; import { Errors } from './errors'; -const rootReducer = combineReducers({ +const appReducer = combineReducers({ AddCoin, toaster, Main, @@ -26,4 +26,14 @@ const rootReducer = combineReducers({ routing: routerReducer, }); +// reset app state on logout +const initialState = appReducer({}, {}); +const rootReducer = (state, action) => { + if (action.type === 'LOGOUT') { + state = initialState; + } + + return appReducer(state, action); +} + export default rootReducer; From f644bd1a80d25aff4613fc6c9069acd0acd5e56c Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 24 Jul 2017 06:11:01 -0700 Subject: [PATCH 10/22] tx history loading placeholder colspan --- react/src/components/dashboard/sendCoin/sendCoin.js | 10 +++++----- .../components/dashboard/walletsData/walletsData.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index b07f438..3d41a4b 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -441,7 +441,7 @@ class SendCoin extends React.Component { json.completed === true) { Store.dispatch( triggerToaster( - translate('TOASTR.SIGNED_TX_GENERATED') + '.', + translate('TOASTR.SIGNED_TX_GENERATED'), translate('TOASTR.WALLET_NOTIFICATION'), 'success' ) @@ -483,7 +483,7 @@ class SendCoin extends React.Component { return new Promise(function(resolve, reject) { Store.dispatch( triggerToaster( - translate('TOASTR.GETTING_TXID_INFO') + '.', + translate('TOASTR.GETTING_TXID_INFO'), translate('TOASTR.WALLET_NOTIFICATION'), 'info' ) @@ -541,7 +541,7 @@ class SendCoin extends React.Component { Store.dispatch( triggerToaster( - translate('TOASTR.AWAITING_TX_RESP') + '...', + `${translate('TOASTR.AWAITING_TX_RESP')}...`, translate('TOASTR.WALLET_NOTIFICATION'), 'info' ) @@ -550,7 +550,7 @@ class SendCoin extends React.Component { function waterfallUTXOProcess() { Store.dispatch( triggerToaster( - translate('TOASTR.PROCESSING_UTXO') + '...', + `${translate('TOASTR.PROCESSING_UTXO')}...`, translate('TOASTR.WALLET_NOTIFICATION'), 'info' ) @@ -591,7 +591,7 @@ class SendCoin extends React.Component { Store.dispatch(sendToAddressStateAlt(json)); Store.dispatch( triggerToaster( - `${translate('TOASTR.SIGNED_TX_GENERATED_FAIL')}.`, + `${translate('TOASTR.SIGNED_TX_GENERATED_FAIL')}`, translate('TOASTR.WALLET_NOTIFICATION'), 'error' ) diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index 71a72b5..b2b4bdc 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -357,14 +357,14 @@ class WalletsData extends React.Component { if (!this.isNativeMode() || this.isFullySynced()) { return ( - { translate('INDEX.LOADING_HISTORY') }... + { translate('INDEX.LOADING_HISTORY') }... ); } } else if (this.state.itemsList === 'no data') { return ( - { translate('INDEX.NO_DATA') } + { translate('INDEX.NO_DATA') } ); } else { From 27bf6da64a0fde47f59b6a231890608b6370ff3b Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 24 Jul 2017 06:13:23 -0700 Subject: [PATCH 11/22] basilisk actions dropdown carret style fix --- .../components/dashboard/walletsData/walletsData.render.js | 2 +- react/src/components/overrides.scss | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index 237a3c2..f8dbc8b 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -152,7 +152,7 @@ export const WalletsDataRender = function() {
{ !this.isNativeMode() ?
{ translate('INDEX.BASILISK_ACTIONS') } diff --git a/react/src/components/overrides.scss b/react/src/components/overrides.scss index 48ba422..5a16904 100644 --- a/react/src/components/overrides.scss +++ b/react/src/components/overrides.scss @@ -608,4 +608,11 @@ select{ .progress { width: inherit; } +} + +.basilisk-actions { + .caret { + margin-left: 10px; + margin-top: -2px; + } } \ No newline at end of file From 072588df35902aaabfea904571928b4652aad2a7 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 24 Jul 2017 06:30:37 -0700 Subject: [PATCH 12/22] hide tx history address dropdown if single addr --- .../walletsData/walletsData.render.js | 50 +++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index f8dbc8b..30e5a88 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -104,28 +104,36 @@ export const TxHistoryListRender = function(tx, index) { }; export const AddressListRender = function() { - return ( -
- -
- + const isMultiPublicAddress = this.props.ActiveCoin.addresses.public && this.props.ActiveCoin.addresses.public.length > 1; + const isMultiPrivateAddress = this.props.ActiveCoin.addresses.private && this.props.ActiveCoin.addresses.private.length > 1; + + if (isMultiPublicAddress || + isMultiPrivateAddress) { + return ( +
+ +
+ +
-
- ); + ); + } else { + return null; + } }; export const WalletsDataRender = function() { From bba59c560fb3ee34296d559a48d3aeadb92a8f8a Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 24 Jul 2017 12:06:17 -0700 Subject: [PATCH 13/22] refactored config var import --- react/src/actions/actions/addCoin.js | 2 +- react/src/actions/actions/addressBalance.js | 6 ++---- react/src/actions/actions/atomic.js | 6 ++---- react/src/actions/actions/basiliskCache.js | 7 ++----- react/src/actions/actions/basiliskProcessAddress.js | 6 ++---- react/src/actions/actions/basiliskTxHistory.js | 2 +- react/src/actions/actions/cli.js | 6 ++---- react/src/actions/actions/coinList.js | 6 ++---- react/src/actions/actions/createWallet.js | 6 ++---- react/src/actions/actions/dexCoins.js | 2 +- react/src/actions/actions/edexBalance.js | 6 ++---- react/src/actions/actions/edexGetTx.js | 6 ++---- react/src/actions/actions/fullTxHistory.js | 2 +- react/src/actions/actions/getAddrByAccount.js | 5 +---- react/src/actions/actions/iguanaHelpers.js | 5 +---- react/src/actions/actions/iguanaInstance.js | 6 ++---- react/src/actions/actions/log.js | 6 ++---- react/src/actions/actions/logout.js | 6 ++---- react/src/actions/actions/nativeBalance.js | 2 +- react/src/actions/actions/nativeNewAddress.js | 2 +- react/src/actions/actions/nativeSend.js | 2 +- react/src/actions/actions/nativeSyncInfo.js | 2 +- react/src/actions/actions/nativeTxHistory.js | 2 +- react/src/actions/actions/notary.js | 6 ++---- react/src/actions/actions/sendFullBasilisk.js | 2 +- react/src/actions/actions/settings.js | 6 ++---- react/src/actions/actions/syncInfo.js | 6 ++---- react/src/actions/actions/syncOnly.js | 6 ++---- react/src/actions/actions/sysInfo.js | 6 ++---- react/src/actions/actions/update.js | 6 ++---- react/src/actions/actions/walletAuth.js | 2 +- react/src/components/addcoin/addcoin.js | 2 +- react/src/components/addcoin/addcoinOptionsCrypto.js | 2 +- .../src/components/dashboard/coinTile/coinTileItem.js | 2 +- react/src/components/dashboard/navbar/navbar.js | 2 +- .../dashboard/notifications/notifications.js | 2 +- react/src/components/dashboard/settings/settings.js | 2 +- .../components/dashboard/walletsData/walletsData.js | 2 +- .../dashboard/walletsData/walletsData.render.js | 4 ++-- .../dashboard/walletsNative/walletsNative.js | 7 ++----- .../src/components/dashboard/walletsNav/walletsNav.js | 2 +- react/src/components/login/login.js | 2 +- react/src/config.js | 11 ++++++++++- react/src/translate/translate.js | 6 +++--- 44 files changed, 75 insertions(+), 112 deletions(-) diff --git a/react/src/actions/actions/addCoin.js b/react/src/actions/actions/addCoin.js index b9db9b5..bd11ef1 100644 --- a/react/src/actions/actions/addCoin.js +++ b/react/src/actions/actions/addCoin.js @@ -1,7 +1,7 @@ import { translate } from '../../translate/translate'; +import Config from '../../config'; import { triggerToaster, - Config, toggleAddcoinModal, getDexCoins, startIguanaInstance, diff --git a/react/src/actions/actions/addressBalance.js b/react/src/actions/actions/addressBalance.js index 665f090..5f16784 100644 --- a/react/src/actions/actions/addressBalance.js +++ b/react/src/actions/actions/addressBalance.js @@ -1,9 +1,6 @@ -import { - ACTIVE_COIN_GET_ADDRESSES -} from '../storeType'; +import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType'; import { triggerToaster, - Config, shepherdGroomPost, getPassthruAgent, iguanaHashHex @@ -12,6 +9,7 @@ import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; function getKMDAddressesNativeState(json) { return { diff --git a/react/src/actions/actions/atomic.js b/react/src/actions/actions/atomic.js index 445cb82..8008e73 100644 --- a/react/src/actions/actions/atomic.js +++ b/react/src/actions/actions/atomic.js @@ -1,12 +1,10 @@ import { ATOMIC } from '../storeType'; -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function atomic(payload) { return dispatch => { diff --git a/react/src/actions/actions/basiliskCache.js b/react/src/actions/actions/basiliskCache.js index bd04c35..07a5713 100644 --- a/react/src/actions/actions/basiliskCache.js +++ b/react/src/actions/actions/basiliskCache.js @@ -1,15 +1,12 @@ import { DASHBOARD_ACTIVE_COIN_GET_CACHE } from '../storeType'; -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; // TODO: rewrite cache API to use POST - export function deleteCacheFile(_payload) { return dispatch => { return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom`, { diff --git a/react/src/actions/actions/basiliskProcessAddress.js b/react/src/actions/actions/basiliskProcessAddress.js index 730d1dc..1a4445b 100644 --- a/react/src/actions/actions/basiliskProcessAddress.js +++ b/react/src/actions/actions/basiliskProcessAddress.js @@ -1,12 +1,10 @@ import { translate } from '../../translate/translate'; -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function checkAddressBasilisk(coin, address) { const payload = { diff --git a/react/src/actions/actions/basiliskTxHistory.js b/react/src/actions/actions/basiliskTxHistory.js index b4c6993..7bbb445 100644 --- a/react/src/actions/actions/basiliskTxHistory.js +++ b/react/src/actions/actions/basiliskTxHistory.js @@ -1,12 +1,12 @@ import { triggerToaster, - Config, getNativeTxHistoryState } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function getBasiliskTransactionsList(coin, address) { const pubkey = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey; diff --git a/react/src/actions/actions/cli.js b/react/src/actions/actions/cli.js index 05e2769..60c4b3b 100644 --- a/react/src/actions/actions/cli.js +++ b/react/src/actions/actions/cli.js @@ -1,12 +1,10 @@ -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; import { CLI } from '../storeType'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function shepherdCliPromise(mode, chain, cmd) { const _payload = { diff --git a/react/src/actions/actions/coinList.js b/react/src/actions/actions/coinList.js index 7885149..f83ab43 100644 --- a/react/src/actions/actions/coinList.js +++ b/react/src/actions/actions/coinList.js @@ -1,11 +1,9 @@ -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function shepherdGetCoinList() { return new Promise((resolve, reject) => { diff --git a/react/src/actions/actions/createWallet.js b/react/src/actions/actions/createWallet.js index 0cce199..cde4df6 100644 --- a/react/src/actions/actions/createWallet.js +++ b/react/src/actions/actions/createWallet.js @@ -1,12 +1,10 @@ import { translate } from '../../translate/translate'; -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; function createNewWalletState(json) { if (json && diff --git a/react/src/actions/actions/dexCoins.js b/react/src/actions/actions/dexCoins.js index 5e85955..8df3a0a 100644 --- a/react/src/actions/actions/dexCoins.js +++ b/react/src/actions/actions/dexCoins.js @@ -1,12 +1,12 @@ import { triggerToaster, - Config, dashboardCoinsState } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function getDexCoins() { const _payload = { diff --git a/react/src/actions/actions/edexBalance.js b/react/src/actions/actions/edexBalance.js index 8926d8c..f54c622 100644 --- a/react/src/actions/actions/edexBalance.js +++ b/react/src/actions/actions/edexBalance.js @@ -1,12 +1,10 @@ import { DASHBOARD_ACTIVE_COIN_BALANCE } from '../storeType'; -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function iguanaEdexBalance(coin) { const _payload = { diff --git a/react/src/actions/actions/edexGetTx.js b/react/src/actions/actions/edexGetTx.js index 2efff6e..aa5b987 100644 --- a/react/src/actions/actions/edexGetTx.js +++ b/react/src/actions/actions/edexGetTx.js @@ -1,11 +1,9 @@ -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function edexGetTransaction(data, dispatch) { const payload = { diff --git a/react/src/actions/actions/fullTxHistory.js b/react/src/actions/actions/fullTxHistory.js index f8914c1..124696a 100644 --- a/react/src/actions/actions/fullTxHistory.js +++ b/react/src/actions/actions/fullTxHistory.js @@ -1,12 +1,12 @@ import { triggerToaster, - Config, getNativeTxHistoryState } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function getFullTransactionsList(coin) { const payload = { diff --git a/react/src/actions/actions/getAddrByAccount.js b/react/src/actions/actions/getAddrByAccount.js index 3cbda4e..0ef1f52 100644 --- a/react/src/actions/actions/getAddrByAccount.js +++ b/react/src/actions/actions/getAddrByAccount.js @@ -1,12 +1,9 @@ import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType'; -import { - triggerToaster, - Config -} from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function getAddressesByAccountState(json, coin, mode) { if (mode === 'full' || diff --git a/react/src/actions/actions/iguanaHelpers.js b/react/src/actions/actions/iguanaHelpers.js index 8c5abf2..a0eb8a9 100644 --- a/react/src/actions/actions/iguanaHelpers.js +++ b/react/src/actions/actions/iguanaHelpers.js @@ -1,11 +1,8 @@ -import { - triggerToaster, - Config -} from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; import { checkAC } from '../../components/addcoin/payload'; export function getPassthruAgent(coin) { diff --git a/react/src/actions/actions/iguanaInstance.js b/react/src/actions/actions/iguanaInstance.js index cacec24..cd69be1 100644 --- a/react/src/actions/actions/iguanaInstance.js +++ b/react/src/actions/actions/iguanaInstance.js @@ -1,11 +1,9 @@ -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function restartIguanaInstance(pmid) { return new Promise((resolve, reject) => { diff --git a/react/src/actions/actions/log.js b/react/src/actions/actions/log.js index bfaca4e..ca42d5b 100644 --- a/react/src/actions/actions/log.js +++ b/react/src/actions/actions/log.js @@ -1,8 +1,6 @@ import { LOG_GUI_HTTP } from '../storeType'; -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; +import Config from '../../config'; export function logGuiHttp(payload) { return dispatch => { diff --git a/react/src/actions/actions/logout.js b/react/src/actions/actions/logout.js index 428f5b8..63f4783 100644 --- a/react/src/actions/actions/logout.js +++ b/react/src/actions/actions/logout.js @@ -2,10 +2,8 @@ import { LOGIN, LOGOUT } from '../storeType'; -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; +import Config from '../../config'; import { logGuiHttp, guiLogState diff --git a/react/src/actions/actions/nativeBalance.js b/react/src/actions/actions/nativeBalance.js index fc2612c..22ebef9 100644 --- a/react/src/actions/actions/nativeBalance.js +++ b/react/src/actions/actions/nativeBalance.js @@ -1,9 +1,9 @@ import { DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE } from '../storeType'; import { triggerToaster, - Config, getPassthruAgent } from '../actionCreators'; +import Config from '../../config'; import { logGuiHttp, guiLogState diff --git a/react/src/actions/actions/nativeNewAddress.js b/react/src/actions/actions/nativeNewAddress.js index bde922e..d41d213 100644 --- a/react/src/actions/actions/nativeNewAddress.js +++ b/react/src/actions/actions/nativeNewAddress.js @@ -1,10 +1,10 @@ import { translate } from '../../translate/translate'; import { triggerToaster, - Config, getPassthruAgent, getKMDAddressesNative } from '../actionCreators'; +import Config from '../../config'; import { logGuiHttp, guiLogState diff --git a/react/src/actions/actions/nativeSend.js b/react/src/actions/actions/nativeSend.js index 9db596f..8fea38e 100644 --- a/react/src/actions/actions/nativeSend.js +++ b/react/src/actions/actions/nativeSend.js @@ -2,7 +2,6 @@ import { DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS } from '../storeType'; import { translate } from '../../translate/translate'; import { triggerToaster, - Config, getPassthruAgent, iguanaHashHex } from '../actionCreators'; @@ -10,6 +9,7 @@ import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function sendNativeTx(coin, _payload) { let ajaxDataToHex; diff --git a/react/src/actions/actions/nativeSyncInfo.js b/react/src/actions/actions/nativeSyncInfo.js index b351e7b..fe3b154 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -1,7 +1,6 @@ import { SYNCING_NATIVE_MODE } from '../storeType'; import { triggerToaster, - Config, getPassthruAgent, getDebugLog } from '../actionCreators'; @@ -9,6 +8,7 @@ import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function getSyncInfoNativeKMD(skipDebug) { const coin = 'KMD'; diff --git a/react/src/actions/actions/nativeTxHistory.js b/react/src/actions/actions/nativeTxHistory.js index c35c447..2bb72de 100644 --- a/react/src/actions/actions/nativeTxHistory.js +++ b/react/src/actions/actions/nativeTxHistory.js @@ -1,9 +1,9 @@ import { triggerToaster, - Config, getPassthruAgent, getNativeTxHistoryState } from '../actionCreators'; +import Config from '../../config'; import { logGuiHttp, guiLogState diff --git a/react/src/actions/actions/notary.js b/react/src/actions/actions/notary.js index afef1e8..d51d0ec 100644 --- a/react/src/actions/actions/notary.js +++ b/react/src/actions/actions/notary.js @@ -3,10 +3,8 @@ import { DASHBOARD_GET_NOTARIES_LIST } from '../storeType'; import { translate } from '../../translate/translate'; -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; +import Config from '../../config'; import { logGuiHttp, guiLogState diff --git a/react/src/actions/actions/sendFullBasilisk.js b/react/src/actions/actions/sendFullBasilisk.js index f8663fe..ee058fd 100644 --- a/react/src/actions/actions/sendFullBasilisk.js +++ b/react/src/actions/actions/sendFullBasilisk.js @@ -2,9 +2,9 @@ import { DASHBOARD_ACTIVE_COIN_SENDTO } from '../storeType'; import { translate } from '../../translate/translate'; import { triggerToaster, - Config, getDispatch } from '../actionCreators'; +import Config from '../../config'; import { logGuiHttp, guiLogState diff --git a/react/src/actions/actions/settings.js b/react/src/actions/actions/settings.js index 2a0ef4b..e1aacb7 100644 --- a/react/src/actions/actions/settings.js +++ b/react/src/actions/actions/settings.js @@ -6,10 +6,8 @@ import { LOAD_APP_CONFIG } from '../storeType'; import { translate } from '../../translate/translate'; -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; +import Config from '../../config'; import { logGuiHttp, guiLogState diff --git a/react/src/actions/actions/syncInfo.js b/react/src/actions/actions/syncInfo.js index 6fa7d46..b24b944 100644 --- a/react/src/actions/actions/syncInfo.js +++ b/react/src/actions/actions/syncInfo.js @@ -1,8 +1,6 @@ import { SYNCING_FULL_MODE } from '../storeType'; -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; +import Config from '../../config'; import { logGuiHttp, guiLogState diff --git a/react/src/actions/actions/syncOnly.js b/react/src/actions/actions/syncOnly.js index a1d40a2..d98aef4 100644 --- a/react/src/actions/actions/syncOnly.js +++ b/react/src/actions/actions/syncOnly.js @@ -3,10 +3,8 @@ import { SYNC_ONLY_DATA } from '../storeType'; import { translate } from '../../translate/translate'; -import { - triggerToaster, - Config -} from '../actionCreators'; +import Config from '../../config'; +import { triggerToaster } from '../actionCreators'; import { logGuiHttp, guiLogState diff --git a/react/src/actions/actions/sysInfo.js b/react/src/actions/actions/sysInfo.js index 740bffa..597e53f 100644 --- a/react/src/actions/actions/sysInfo.js +++ b/react/src/actions/actions/sysInfo.js @@ -1,7 +1,5 @@ -import { - triggerToaster, - Config -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; +import Config from '../../config'; import { logGuiHttp, guiLogState diff --git a/react/src/actions/actions/update.js b/react/src/actions/actions/update.js index 457c22b..7ddd761 100644 --- a/react/src/actions/actions/update.js +++ b/react/src/actions/actions/update.js @@ -1,7 +1,5 @@ -import { - Config, - triggerToaster -} from '../actionCreators'; +import { triggerToaster } from '../actionCreators'; +import Config from '../../config'; import { logGuiHttp, guiLogState diff --git a/react/src/actions/actions/walletAuth.js b/react/src/actions/actions/walletAuth.js index 72ddd8b..aa5d767 100644 --- a/react/src/actions/actions/walletAuth.js +++ b/react/src/actions/actions/walletAuth.js @@ -3,9 +3,9 @@ import { ACTIVE_HANDLE } from '../storeType'; import { translate } from '../../translate/translate'; +import Config from '../../config'; import { triggerToaster, - Config, getMainAddressState, updateErrosStack } from '../actionCreators'; diff --git a/react/src/components/addcoin/addcoin.js b/react/src/components/addcoin/addcoin.js index a113599..55295d7 100644 --- a/react/src/components/addcoin/addcoin.js +++ b/react/src/components/addcoin/addcoin.js @@ -1,7 +1,7 @@ import React from 'react'; import { translate } from '../../translate/translate'; +import Config from '../../config'; import { - Config, addCoin, toggleAddcoinModal, triggerToaster, diff --git a/react/src/components/addcoin/addcoinOptionsCrypto.js b/react/src/components/addcoin/addcoinOptionsCrypto.js index f3ed6ff..fec1d56 100644 --- a/react/src/components/addcoin/addcoinOptionsCrypto.js +++ b/react/src/components/addcoin/addcoinOptionsCrypto.js @@ -1,6 +1,6 @@ import React from 'react'; import { translate } from '../../translate/translate'; -import { Config } from '../../actions/actionCreators'; +import Config from '../../config'; class AddCoinOptionsCrypto extends React.Component { constructor(props) { diff --git a/react/src/components/dashboard/coinTile/coinTileItem.js b/react/src/components/dashboard/coinTile/coinTileItem.js index 27eac65..70960f4 100644 --- a/react/src/components/dashboard/coinTile/coinTileItem.js +++ b/react/src/components/dashboard/coinTile/coinTileItem.js @@ -1,6 +1,5 @@ import React from 'react'; import { - Config, dashboardChangeActiveCoin, iguanaActiveHandle, getAddressesByAccount, @@ -21,6 +20,7 @@ import { getDebugLog } from '../../../actions/actionCreators'; import Store from '../../../store'; +import Config from '../../../config'; import CoinTileItemRender from './coinTileItem.render'; diff --git a/react/src/components/dashboard/navbar/navbar.js b/react/src/components/dashboard/navbar/navbar.js index a8b2132..6480b97 100755 --- a/react/src/components/dashboard/navbar/navbar.js +++ b/react/src/components/dashboard/navbar/navbar.js @@ -7,9 +7,9 @@ import { toggleSyncOnlyModal, getSyncOnlyForks, logout, - Config } from '../../../actions/actionCreators'; import Store from '../../../store'; +import Config from '../../../config'; import NavbarRender from './navbar.render'; diff --git a/react/src/components/dashboard/notifications/notifications.js b/react/src/components/dashboard/notifications/notifications.js index 64c2acc..0d04d1f 100755 --- a/react/src/components/dashboard/notifications/notifications.js +++ b/react/src/components/dashboard/notifications/notifications.js @@ -1,6 +1,6 @@ import React from 'react'; import { sortByDate } from '../../../util/sort'; -import { Config } from '../../../actions/actionCreators'; +import Config from '../../../config'; import { NotificationsByTypeRender, NotificationsModalRender, diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 2c82d39..89634b3 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -1,7 +1,7 @@ import React from 'react'; import { translate } from '../../../translate/translate'; +import Config from '../../../config'; import { - Config, iguanaActiveHandle, encryptWallet, settingsWifkeyState, diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index b2b4bdc..a0527b1 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -1,8 +1,8 @@ import React from 'react'; import { translate } from '../../../translate/translate'; import { sortByDate } from '../../../util/sort'; +import Config from '../../../config'; import { - Config, basiliskRefresh, basiliskConnection, toggleDashboardTxInfoModal, diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index 30e5a88..d3afe4a 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -104,8 +104,8 @@ export const TxHistoryListRender = function(tx, index) { }; export const AddressListRender = function() { - const isMultiPublicAddress = this.props.ActiveCoin.addresses.public && this.props.ActiveCoin.addresses.public.length > 1; - const isMultiPrivateAddress = this.props.ActiveCoin.addresses.private && this.props.ActiveCoin.addresses.private.length > 1; + const isMultiPublicAddress = this.props.ActiveCoin.addresses && this.props.ActiveCoin.addresses.public && this.props.ActiveCoin.addresses.public.length > 1; + const isMultiPrivateAddress = this.props.ActiveCoin.addresses && this.props.ActiveCoin.addresses.private && this.props.ActiveCoin.addresses.private.length > 1; if (isMultiPublicAddress || isMultiPrivateAddress) { diff --git a/react/src/components/dashboard/walletsNative/walletsNative.js b/react/src/components/dashboard/walletsNative/walletsNative.js index 0168910..764a55e 100644 --- a/react/src/components/dashboard/walletsNative/walletsNative.js +++ b/react/src/components/dashboard/walletsNative/walletsNative.js @@ -1,11 +1,8 @@ import React from 'react'; import WalletsNativeRender from './walletsNative.render'; import { translate } from '../../../translate/translate'; - -import { - Config, - triggerToaster -} from '../../../actions/actionCreators'; +import { triggerToaster } from '../../../actions/actionCreators'; +import Config from '../../../config'; import Store from '../../../store'; import { SocketProvider } from 'socket.io-react'; diff --git a/react/src/components/dashboard/walletsNav/walletsNav.js b/react/src/components/dashboard/walletsNav/walletsNav.js index c6fe52d..0835bfd 100644 --- a/react/src/components/dashboard/walletsNav/walletsNav.js +++ b/react/src/components/dashboard/walletsNav/walletsNav.js @@ -1,6 +1,5 @@ import React from 'react'; import { - Config, copyCoinAddress, iguanaEdexBalance, toggleSendCoinForm, @@ -9,6 +8,7 @@ import { toggleDashboardActiveSection } from '../../../actions/actionCreators'; import Store from '../../../store'; +import Config from '../../../config'; import { WalletsNavNoWalletRender, WalletsNavWithWalletRender diff --git a/react/src/components/login/login.js b/react/src/components/login/login.js index 47f8b0b..9fd8bc4 100644 --- a/react/src/components/login/login.js +++ b/react/src/components/login/login.js @@ -1,6 +1,5 @@ import React from 'react'; import { - Config, toggleAddcoinModal, iguanaWalletPassphrase, iguanaActiveHandle, @@ -11,6 +10,7 @@ import { createNewWallet, triggerToaster } from '../../actions/actionCreators'; +import Config from '../../config'; import Store from '../../store'; import { PassPhraseGenerator } from '../../util/crypto/passphrasegenerator'; import SwallModalRender from './swall-modal.render'; diff --git a/react/src/config.js b/react/src/config.js index 39149ed..c8c7a8e 100644 --- a/react/src/config.js +++ b/react/src/config.js @@ -1,4 +1,5 @@ -module.exports = { +let Config; +let _config = { iguanaCorePort: 7778, agamaPort: 17777, enableCacheApi: true, @@ -12,3 +13,11 @@ module.exports = { }, iguanaLessMode: true, }; + +try { + Config = window.require('electron').remote.getCurrentWindow().appConfig; +} catch (e) { + Config = _config; +} + +export default Config; \ No newline at end of file diff --git a/react/src/translate/translate.js b/react/src/translate/translate.js index d509820..060f05d 100644 --- a/react/src/translate/translate.js +++ b/react/src/translate/translate.js @@ -2,7 +2,7 @@ import { _lang } from './en'; import Config from '../config'; export function translate(langID) { - let defaultLang = Config.defaultLang; + let defaultLang = Config.defaultLang || 'EN'; if (langID && langID.indexOf('.') > -1) { @@ -13,12 +13,12 @@ export function translate(langID) { _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) { return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]; } else { - console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); + console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); return '--> ' + langID + ' <--'; } } else { if (langID.length) { - console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); + console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); return '--> ' + langID + ' <--'; } } From cd5a9034bf2dd63152b90deb46c71741cd0308b1 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 24 Jul 2017 12:37:03 -0700 Subject: [PATCH 14/22] prevent seed generate on each radio btn click --- react/src/components/login/login.render.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/react/src/components/login/login.render.js b/react/src/components/login/login.render.js index 5d8c7c0..50f7995 100644 --- a/react/src/components/login/login.render.js +++ b/react/src/components/login/login.render.js @@ -159,33 +159,36 @@ const LoginRender = function () {
this.generateNewSeed(256) }> + onClick={ () =>this.state.bitsOption !== 256 && this.generateNewSeed(256) }> + checked={ this.state.bitsOption === 256 } + readOnly />
this.generateNewSeed(160) }> + onClick={ () => this.state.bitsOption !== 160 && this.generateNewSeed(160) }> + checked={ this.state.bitsOption === 160 } + readOnly />
this.generateNewSeed(128) }> + onClick={ () => this.state.bitsOption !== 128 && this.generateNewSeed(128) }> + checked={ this.state.bitsOption === 128 } + readOnly /> From 3640a807ef75d75c849dc9d60a5764bd4482fe5c Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 24 Jul 2017 12:52:42 -0700 Subject: [PATCH 15/22] fixed react warnings --- react/src/actions/actionCreators.js | 9 ------- .../components/dashboard/settings/settings.js | 2 +- .../dashboard/settings/settings.render.js | 4 +-- .../walletsBalance/walletsBalance.js | 2 +- react/src/components/login/login.scss | 25 +++++++++++-------- 5 files changed, 19 insertions(+), 23 deletions(-) diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index 42f2055..667896d 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -1,7 +1,6 @@ import 'whatwg-fetch'; import 'bluebird'; -import _config from '../config'; import { translate } from '../translate/translate'; import { GET_ACTIVE_COINS, @@ -68,14 +67,6 @@ export * from './actions/iguanaHelpers'; export * from './actions/cli'; export * from './actions/update'; -export let Config; - -try { - Config = window.require('electron').remote.getCurrentWindow().appConfig; -} catch (e) { - Config = _config; -} - export function changeActiveAddress(address) { return { type: DASHBOARD_ACTIVE_ADDRESS, diff --git a/react/src/components/dashboard/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 89634b3..109f936 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -49,7 +49,7 @@ class Settings extends React.Component { activeTabHeight: '0', appSettings: {}, tabElId: null, - cliCmdString: null, + cliCmdString: '', cliCoin: null, cliResponse: null, exportWifKeysRaw: false, diff --git a/react/src/components/dashboard/settings/settings.render.js b/react/src/components/dashboard/settings/settings.render.js index 084bb90..47d4fd4 100644 --- a/react/src/components/dashboard/settings/settings.render.js +++ b/react/src/components/dashboard/settings/settings.render.js @@ -338,7 +338,7 @@ export const SettingsRender = function() { className={ 'panel-collapse collapse' + (this.state.activeTab === 4 ? ' in' : '') } style={{ height: this.state.activeTab === 4 ? `${this.state.activeTabHeight}px` : '0' }}>
-

+

{ this.renderLB('INDEX.ONLY_ACTIVE_WIF_KEYS') }
{ this.renderLB('SETTINGS.EXPORT_KEYS_NOTE') } @@ -346,7 +346,7 @@ export const SettingsRender = function() { { translate('INDEX.PLEASE_KEEP_KEYS_SAFE') } -

+
'); return _translationComponents.map((_translation) => - + {_translation}
diff --git a/react/src/components/login/login.scss b/react/src/components/login/login.scss index 29897ee..ed3e5c3 100644 --- a/react/src/components/login/login.scss +++ b/react/src/components/login/login.scss @@ -16,6 +16,17 @@ } button { + &.copy-floating-label { + position: absolute; + font-weight: 500; + font-size: 14px; + top: -22px; + right: 0; + background-color: #757575; + border: 0; + cursor: pointer; + z-index: 1000; + } &.swal2-confirm-container { background-color: rgb(48, 133, 214); border-left-color: rgb(48, 133, 214); @@ -111,14 +122,8 @@ input[type="password"] { margin-right: auto; } -button.copy-floating-label { - position: absolute; - font-weight: 500; - font-size: 11.2px; - top: -11px; - right: 0; - background-color: #757575; - border: 0; - cursor: pointer; - z-index: 1000; +.register-form { + .floating-label { + font-size: 13px; + } } \ No newline at end of file From 4772dcfc7f74ca2fc629a34928b5454bb88b7b45 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 24 Jul 2017 12:55:53 -0700 Subject: [PATCH 16/22] updated about --- react/src/components/dashboard/about/about.js | 114 +++++++++--------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/react/src/components/dashboard/about/about.js b/react/src/components/dashboard/about/about.js index 2a8f4e0..a38ea04 100755 --- a/react/src/components/dashboard/about/about.js +++ b/react/src/components/dashboard/about/about.js @@ -6,68 +6,68 @@ class About extends React.Component {

About Agama

-

Agama Wallet is a desktop app that you can use to manage multiple cryptocurrency wallets. When you set up a +

+ Agama Wallet is a desktop app that you can use to manage multiple cryptocurrency wallets. When you set up a wallet, you can configure it to operate in one of the following modes: +

+
    +
  • + Basilisk Mode:  + Doesn't download the blockchain. Slightly slower + transaction performance. +
  • +
  • + Full Mode:  + Downloads the full blockchain, which can take a + while. Good transaction performance. +
  • +
  • + Native Mode:  + Only available for a few currencies. Like 'Full + Mode' but provides advanced functionality. +
  • +
-
    -
  • - Basilisk Mode:  - Doesn't download the blockchain. Slightly slower - transaction performance. -
  • -
  • - Full Mode:  - Downloads the full blockchain, which can take a - while. Good transaction performance. -
  • -
  • - Native Mode:  - Only available for a few currencies. Like 'Full - Mode' but provides advanced functionality. -
  • -
- - Agama includes the following capabilities: -
    -
  • - BarterDEX:  - Easily exchange cryptocurrencies via a - shapeshift-like service. - - (BarterDEX – A Practical Native DEX) - -
  • -
  • - Atomic Exporer:  - A universal local explorer ensures you don't - have query information from a centralized - server. -
  • -
- - - Note: Agama Wallet is still in development. It is safe to use, - but you should make proper backups. We do not recommend using it as the primarily wallet for your cryptocurrencies. - + Agama includes the following capabilities: +
    +
  • + BarterDEX:  + Easily exchange cryptocurrencies via a + shapeshift-like service.  + + (BarterDEX – A Practical Native DEX) + +
  • +
  • + Atomic Exporer:   + A universal local explorer ensures you don't + have query information from a centralized + server. +
  • +
-
+ + Note: Agama Wallet is still in development. It is safe to use, + but you should make proper backups. We do not recommend using it as the primarily wallet for your cryptocurrencies. + - Testers:  - You can help us test Agama. Just download and install the latest release. - Then, report any bugs you encounter to our developers on the #testing-agama Slack channel. - Your help is greatly appreciated! +

- Agama also supports the following desktop apps: -
    -
  • - Jumblr: A decentralized Bitcoin blockchain tumbler for privacy - and lower fees. -
  • -
  • - BarterDEX -
  • -
-

+
Testers
+ You can help us test Agama. Just download and install the latest release. + Then, report any bugs you encounter to our developers on the #testing-agama Slack channel. + Your help is greatly appreciated! +

+ Agama also supports the following desktop apps: +
    +
  • + Jumblr: A decentralized Bitcoin blockchain tumbler for privacy + and lower fees. +
  • +
  • + BarterDEX: A decentralized coin exchange. +
  • +
); From 52b9bc231ee19e7f7c9e7f73b165090b5a043242 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 24 Jul 2017 13:54:34 -0700 Subject: [PATCH 17/22] updated change.log --- react/change.log | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/react/change.log b/react/change.log index ade5842..983003c 100644 --- a/react/change.log +++ b/react/change.log @@ -1,3 +1,13 @@ +v0.2.0.22a-beta +-------------- +UI: +- fixed activating best chain progress update +- prevent running two agama instances +- cli passphru fix +- fixed logout bug +- minor placeholders fixes +- hide address dropdown if wallet has only one address + v0.2.0.21a-beta -------------- UI: From b03d830ef2f2660356d1c1757ed4a5e8c9c424fb Mon Sep 17 00:00:00 2001 From: pbca26 Date: Tue, 25 Jul 2017 06:08:37 -0700 Subject: [PATCH 18/22] display debug.log data if komodod is crashed/exited --- react/src/actions/actionCreators.js | 8 ++++ react/src/actions/actions/nativeSyncInfo.js | 7 ++- react/src/actions/storeType.js | 3 +- .../dashboard/coinTile/coinTileItem.js | 3 +- .../coindDownModal/coindDownModal.js | 47 +++++++++++++++++++ .../coindDownModal/coindDownModal.render.js | 46 ++++++++++++++++++ .../dashboard/main/dashboard.render.js | 2 + react/src/components/overrides.scss | 22 +++++++++ react/src/reducers/dashboard.js | 9 +++- 9 files changed, 142 insertions(+), 5 deletions(-) create mode 100644 react/src/components/dashboard/coindDownModal/coindDownModal.js create mode 100644 react/src/components/dashboard/coindDownModal/coindDownModal.render.js diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index 667896d..baf8d37 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -25,6 +25,7 @@ import { DASHBOARD_ACTIVE_COIN_CHANGE, ACTIVE_COIN_GET_ADDRESSES, DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY, + DISPLAY_COIND_DOWN_MODAL, START_INTERVAL, STOP_INTERVAL } from './storeType'; @@ -350,4 +351,11 @@ export function stopInterval(name, intervals) { type: STOP_INTERVAL, name, } +} + +export function toggleCoindDownModal(display) { + return { + type: DISPLAY_COIND_DOWN_MODAL, + displayCoindDownModal: display, + } } \ No newline at end of file diff --git a/react/src/actions/actions/nativeSyncInfo.js b/react/src/actions/actions/nativeSyncInfo.js index fe3b154..ed7c6cb 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -2,7 +2,8 @@ import { SYNCING_NATIVE_MODE } from '../storeType'; import { triggerToaster, getPassthruAgent, - getDebugLog + getDebugLog, + toggleCoindDownModal } from '../actionCreators'; import { logGuiHttp, @@ -157,9 +158,11 @@ export function getSyncInfoNative(coin, skipDebug) { 'Komodod is down', 'Critical Error', 'error', - false + true ) ); + dispatch(getDebugLog('komodo', 50)); + dispatch(toggleCoindDownModal(true)); } else { json = JSON.parse(json); } diff --git a/react/src/actions/storeType.js b/react/src/actions/storeType.js index e38874a..d00021b 100644 --- a/react/src/actions/storeType.js +++ b/react/src/actions/storeType.js @@ -43,4 +43,5 @@ export const DASHBOARD_ACTIVE_ADDRESS = 'DASHBOARD_ACTIVE_ADDRESS'; export const LOAD_APP_INFO = 'LOAD_APP_INFO'; export const LOG_GUI_HTTP = 'LOG_GUI_HTTP'; export const CLI = 'CLI'; -export const LOGOUT = 'LOGOUT'; \ No newline at end of file +export const LOGOUT = 'LOGOUT'; +export const DISPLAY_COIND_DOWN_MODAL = 'DISPLAY_COIND_DOWN_MODAL'; \ No newline at end of file diff --git a/react/src/components/dashboard/coinTile/coinTileItem.js b/react/src/components/dashboard/coinTile/coinTileItem.js index 70960f4..89ba633 100644 --- a/react/src/components/dashboard/coinTile/coinTileItem.js +++ b/react/src/components/dashboard/coinTile/coinTileItem.js @@ -46,7 +46,8 @@ class CoinTileItem extends React.Component { const _propsDashboard = this.props.Dashboard; const syncPercentage = _propsDashboard && _propsDashboard.progress && (parseFloat(parseInt(_propsDashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0); - if (syncPercentage < 100) { + if (syncPercentage < 100 && + !this.props.Dashboard.displayCoindDownModal) { Store.dispatch(getDebugLog('komodo', 10)); } if (_propsDashboard.progress && diff --git a/react/src/components/dashboard/coindDownModal/coindDownModal.js b/react/src/components/dashboard/coindDownModal/coindDownModal.js new file mode 100644 index 0000000..7d082a2 --- /dev/null +++ b/react/src/components/dashboard/coindDownModal/coindDownModal.js @@ -0,0 +1,47 @@ +import React from 'react'; +import { toggleCoindDownModal } from '../../../actions/actionCreators'; +import Store from '../../../store'; + +import CoindDownModalRender from './coindDownModal.render'; + +class CoindDownModal extends React.Component { + constructor(props) { + super(props); + this.state = { + display: false, + debugLogCrash: null, + }; + this.dismiss = this.dismiss.bind(this); + } + + dismiss() { + Store.dispatch(toggleCoindDownModal(false)); + } + + componentWillReceiveProps(props) { + const coindDownModalProps = props ? props.Dashboard : null; + + if (coindDownModalProps && + coindDownModalProps.displayCoindDownModal !== this.state.display) { + this.setState(Object.assign({}, this.state, { + display: coindDownModalProps.displayCoindDownModal, + })); + + setTimeout(() => { + this.setState(Object.assign({}, this.state, { + display: coindDownModalProps.displayCoindDownModal, + })); + }, 100); + } + } + + render() { + if (this.state.display) { + return CoindDownModalRender.call(this); + } + + return null; + } +} + +export default CoindDownModal; diff --git a/react/src/components/dashboard/coindDownModal/coindDownModal.render.js b/react/src/components/dashboard/coindDownModal/coindDownModal.render.js new file mode 100644 index 0000000..548e661 --- /dev/null +++ b/react/src/components/dashboard/coindDownModal/coindDownModal.render.js @@ -0,0 +1,46 @@ +import React from 'react'; +import { translate } from '../../../translate/translate'; + +const CoindDownModalRender = function () { + return ( +
+
+
+
+
+ +

Komodod is down!

+
+
+
+
+ Debug.log (last 50 lines) +
+ +
+ +
+
+
+
+
+
+
+
+ ); +}; + +export default CoindDownModalRender; \ No newline at end of file diff --git a/react/src/components/dashboard/main/dashboard.render.js b/react/src/components/dashboard/main/dashboard.render.js index 0d201a2..89ae040 100644 --- a/react/src/components/dashboard/main/dashboard.render.js +++ b/react/src/components/dashboard/main/dashboard.render.js @@ -15,6 +15,7 @@ import ReceiveCoin from '../receiveCoin/receiveCoin'; import About from '../about/about'; import WalletsNative from '../walletsNative/walletsNative'; import WalletsTxInfo from '../walletsTxInfo/walletsTxInfo'; +import CoindDownModal from '../coindDownModal/coindDownModal'; const DashboardRender = function() { return ( @@ -23,6 +24,7 @@ const DashboardRender = function() { className={ this.isSectionActive('wallets') ? 'page-main' : '' } id="section-dashboard"> +
diff --git a/react/src/components/overrides.scss b/react/src/components/overrides.scss index 5a16904..a7d18ea 100644 --- a/react/src/components/overrides.scss +++ b/react/src/components/overrides.scss @@ -615,4 +615,26 @@ select{ margin-left: 10px; margin-top: -2px; } +} + +.clipboard-edexaddr { + margin-left: 10px; +} + +.coind-down-modal { + .modal-body { + height: 60vh; + + > div { + height: 100%; + } + .page-content { + width: 90%; + height: 100%; + + textarea { + min-height: 200px; + } + } + } } \ No newline at end of file diff --git a/react/src/reducers/dashboard.js b/react/src/reducers/dashboard.js index a57c8a2..98df82e 100644 --- a/react/src/reducers/dashboard.js +++ b/react/src/reducers/dashboard.js @@ -8,7 +8,8 @@ import { DASHBOARD_CONNECT_NOTARIES, VIEW_CACHE_DATA, LOG_GUI_HTTP, - TOGGLE_NOTIFICATIONS_MODAL + TOGGLE_NOTIFICATIONS_MODAL, + DISPLAY_COIND_DOWN_MODAL } from '../actions/storeType'; const HTTP_STACK_MAX_ENTRIES = 150; // limit stack mem length to N records per type @@ -36,6 +37,7 @@ export function Dashboard(state = { failedToConnectNodes: null, }, guiLog: {}, + displayCoindDownModal: false, }, action) { switch (action.type) { case DASHBOARD_SECTION_CHANGE: @@ -97,6 +99,11 @@ export function Dashboard(state = { return Object.assign({}, state, { guiLog: newLogState, }); + case DISPLAY_COIND_DOWN_MODAL: + return Object.assign({}, state, { + displayCoindDownModal: action.displayCoindDownModal, + }); + break; default: return state; } From b672b5914ea608b79a3cbbad3ac4625ad02500af Mon Sep 17 00:00:00 2001 From: pbca26 Date: Tue, 25 Jul 2017 07:05:39 -0700 Subject: [PATCH 19/22] gray background height fix --- react/src/components/dashboard/atomic/atomic.render.js | 2 +- react/src/components/dashboard/coinTile/coinTileItem.js | 3 ++- react/src/components/dashboard/main/dashboard.render.js | 2 +- .../components/dashboard/walletsData/walletsData.render.js | 2 +- react/src/components/overrides.scss | 4 ++++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/react/src/components/dashboard/atomic/atomic.render.js b/react/src/components/dashboard/atomic/atomic.render.js index 7de3c3c..d15343f 100644 --- a/react/src/components/dashboard/atomic/atomic.render.js +++ b/react/src/components/dashboard/atomic/atomic.render.js @@ -7,7 +7,7 @@ import AddCoinOptionsACFiat from '../../addcoin/addcoinOptionsACFiat'; const AtomicRender = function () { return ( -
+
diff --git a/react/src/components/dashboard/coinTile/coinTileItem.js b/react/src/components/dashboard/coinTile/coinTileItem.js index 89ba633..3e41952 100644 --- a/react/src/components/dashboard/coinTile/coinTileItem.js +++ b/react/src/components/dashboard/coinTile/coinTileItem.js @@ -50,7 +50,8 @@ class CoinTileItem extends React.Component { !this.props.Dashboard.displayCoindDownModal) { Store.dispatch(getDebugLog('komodo', 10)); } - if (_propsDashboard.progress && + if (!this.props.Dashboard.displayCoindDownModal && + _propsDashboard.progress && _propsDashboard.progress.blocks && _propsDashboard.progress.longestchain && syncPercentage && diff --git a/react/src/components/dashboard/main/dashboard.render.js b/react/src/components/dashboard/main/dashboard.render.js index 89ae040..580f60e 100644 --- a/react/src/components/dashboard/main/dashboard.render.js +++ b/react/src/components/dashboard/main/dashboard.render.js @@ -39,7 +39,7 @@ const DashboardRender = function() {
-
+
diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index d3afe4a..d304d3f 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -144,7 +144,7 @@ export const WalletsDataRender = function() {
-
+
diff --git a/react/src/components/overrides.scss b/react/src/components/overrides.scss index a7d18ea..55cd8a3 100644 --- a/react/src/components/overrides.scss +++ b/react/src/components/overrides.scss @@ -637,4 +637,8 @@ select{ } } } +} + +.backround-gray { + background: #f3f4f5; } \ No newline at end of file From 7360cf0e370b874a7432bf13378ea0e84198db89 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Tue, 25 Jul 2017 12:32:02 -0700 Subject: [PATCH 20/22] round values --- .../walletsBalance/walletsBalance.render.js | 26 +++++++++++++------ .../dashboard/walletsData/walletsData.js | 7 ++++- .../walletsData/walletsData.render.js | 9 ++++++- .../walletsTxInfo/walletsTxInfo.render.js | 4 ++- react/src/config.js | 1 + 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js index 1ccd9af..5a97998 100644 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js @@ -1,5 +1,7 @@ import React from 'react'; import { translate } from '../../../translate/translate'; +import { formatValue } from '../../../util/formatValue'; +import Config from '../../../config'; const WalletsBalanceRender = function() { return ( @@ -30,12 +32,14 @@ const WalletsBalanceRender = function() { { this.isNativeMode() ? translate('INDEX.TRANSPARENT_BALANCE') : translate('INDEX.BALANCE') }
- + { this.isNativeMode() ? this.props.ActiveCoin.balance.transparent ? this.props.ActiveCoin.balance.transparent : '-' : - { this.renderBalance('main') } { this.props.ActiveCoin.coin } + { Config.roundValues ? formatValue('round', this.renderBalance('main'), -6) : this.renderBalance('main') } { this.props.ActiveCoin.coin } } @@ -54,8 +58,10 @@ const WalletsBalanceRender = function() { { translate('INDEX.Z_BALANCE') }
- - { this.props.ActiveCoin.balance.private ? this.props.ActiveCoin.balance.private : '-' } + + { this.props.ActiveCoin.balance.private ? (Config.roundValues ? formatValue('round', this.props.ActiveCoin.balance.private, -6) : this.props.ActiveCoin.balance.private) : '-' }
@@ -73,13 +79,15 @@ const WalletsBalanceRender = function() { { translate('INDEX.INTEREST_EARNED') }
- + { this.isNativeMode() ? this.props.Dashboard.progress && this.props.Dashboard.progress.interest ? this.props.Dashboard.progress.interest : '-' : - {this.renderBalance('interest')} {this.props.ActiveCoin.coin} + { Config.roundValues ? formatValue('round', this.renderBalance('interest'), -6) : this.renderBalance('interest') } { this.props.ActiveCoin.coin } } @@ -99,12 +107,14 @@ const WalletsBalanceRender = function() { { translate('INDEX.TOTAL_BALANCE') }
- + { this.isNativeMode() ? this.props.ActiveCoin.balance.total ? this.props.ActiveCoin.balance.total : '-' : - { this.renderBalance('total') } { this.props.ActiveCoin.coin } + { Config.roundValues ? formatValue('round', this.renderBalance('total'), -6) : this.renderBalance('total') } { this.props.ActiveCoin.coin } } diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index a0527b1..2dffcd5 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -1,6 +1,7 @@ import React from 'react'; import { translate } from '../../../translate/translate'; import { sortByDate } from '../../../util/sort'; +import { formatValue } from '../../../util/formatValue'; import Config from '../../../config'; import { basiliskRefresh, @@ -448,6 +449,8 @@ 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); + items.push(
  • this.updateAddressSelection(address, type, _amount) }> @@ -484,7 +487,9 @@ class WalletsData extends React.Component { return _addresses.public[i].amount; } else { const address = _addresses.public[i].address; - const _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'; + 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); return _amount; } diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index d304d3f..f7e6fbb 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -5,6 +5,8 @@ import WalletsBasiliskConnection from '../walletsBasiliskConnection/walletsBasil import WalletsNotariesList from '../walletsNotariesList/walletsNotariesList'; import WalletsCacheData from '../walletsCacheData/walletsCacheData'; import { secondsToString } from '../../../util/time'; +import { formatValue } from '../../../util/formatValue'; +import Config from '../../../config'; // TODO: clean basilisk dropdown menu @@ -87,7 +89,12 @@ export const TxHistoryListRender = function(tx, index) { } { this.renderTxType(tx.category || tx.type) } { tx.confirmations } - { tx.amount || translate('DASHBOARD.UNKNOWN') } + { Config.roundValues && + { formatValue('round', tx.amount, -6) || translate('DASHBOARD.UNKNOWN') } + } + { !Config.roundValues && + { tx.amount || translate('DASHBOARD.UNKNOWN') } + } { secondsToString(tx.blocktime || tx.timestamp || tx.time) } { tx.address } { this.renderAddress(tx) } diff --git a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js index bd7ea05..7b9643b 100644 --- a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js +++ b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js @@ -1,6 +1,8 @@ import React from 'react'; import { translate } from '../../../translate/translate'; import { secondsToString } from '../../../util/time'; +import { formatValue } from '../../../util/formatValue'; +import Config from '../../../config'; const WalletsTxInfoRender = function(txInfo) { return ( @@ -55,7 +57,7 @@ const WalletsTxInfoRender = function(txInfo) { { translate('TX_INFO.AMOUNT') } - { txInfo.amount } + { Config.roundValues ? formatValue('round', txInfo.amount, -10) : txInfo.amount } diff --git a/react/src/config.js b/react/src/config.js index c8c7a8e..858ceb0 100644 --- a/react/src/config.js +++ b/react/src/config.js @@ -12,6 +12,7 @@ let _config = { default: true }, iguanaLessMode: true, + roundValues: true, }; try { From a7e6cd1917ed7a45f74b167c9872d9616da9b231 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Tue, 25 Jul 2017 13:25:07 -0700 Subject: [PATCH 21/22] addcoin modal multi ui reflow fix --- react/change.log | 3 +++ .../src/components/addcoin/addcoin.render.js | 4 ++-- react/src/components/addcoin/addcoin.scss | 2 +- .../addcoin/coin-selectors.render.js | 24 ++++++++++++++++--- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/react/change.log b/react/change.log index 983003c..534043b 100644 --- a/react/change.log +++ b/react/change.log @@ -7,6 +7,9 @@ UI: - fixed logout bug - minor placeholders fixes - hide address dropdown if wallet has only one address +- komodod crash report modal +- values rounding (up to 6 decimals) +- add coin multi ui reflow fix v0.2.0.21a-beta -------------- diff --git a/react/src/components/addcoin/addcoin.render.js b/react/src/components/addcoin/addcoin.render.js index 1e56a08..110ab88 100644 --- a/react/src/components/addcoin/addcoin.render.js +++ b/react/src/components/addcoin/addcoin.render.js @@ -42,7 +42,7 @@ const AddCoinRender = function() { { this.renderCoinSelectors() } -
    +
    -
    +