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; diff --git a/react/change.log b/react/change.log index ade5842..534043b 100644 --- a/react/change.log +++ b/react/change.log @@ -1,3 +1,16 @@ +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 +- komodod crash report modal +- values rounding (up to 6 decimals) +- add coin multi ui reflow fix + v0.2.0.21a-beta -------------- UI: diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index 42f2055..baf8d37 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, @@ -26,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'; @@ -68,14 +68,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, @@ -359,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/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 933c869..63f4783 100644 --- a/react/src/actions/actions/logout.js +++ b/react/src/actions/actions/logout.js @@ -1,14 +1,15 @@ -import { LOGIN } from '../storeType'; import { - triggerToaster, - Config -} from '../actionCreators'; + LOGIN, + LOGOUT +} from '../storeType'; +import { triggerToaster } from '../actionCreators'; +import Config from '../../config'; import { logGuiHttp, guiLogState } from './log'; -function logoutState(json, dispatch) { +function logoutState(json) { sessionStorage.removeItem('IguanaActiveAccount'); return { @@ -17,6 +18,12 @@ function logoutState(json, dispatch) { } } +function logoutResetAppState() { + return { + type: LOGOUT, + } +} + export function logout() { return dispatch => { dispatch(walletLock()); @@ -68,6 +75,7 @@ function walletLock() { 'response': json, })); dispatch(logoutState(json)); + dispatch(logoutResetAppState()); }) } } \ No newline at end of file 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 2bbf5a9..ed7c6cb 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -1,14 +1,15 @@ import { SYNCING_NATIVE_MODE } from '../storeType'; import { triggerToaster, - Config, getPassthruAgent, - getDebugLog + getDebugLog, + toggleCoindDownModal } from '../actionCreators'; import { logGuiHttp, guiLogState } from './log'; +import Config from '../../config'; export function getSyncInfoNativeKMD(skipDebug) { const coin = 'KMD'; @@ -63,7 +64,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 +73,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, } } } @@ -156,13 +158,20 @@ 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); } + 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/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..126f10b 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 @@ -378,7 +376,16 @@ export function saveAppConfig(_payload) { ); }) .then(response => response.json()) - .then(json => dispatch(getAppConfig())) + .then(json => { + dispatch(getAppConfig()); + dispatch( + triggerToaster( + 'Settings are saved', + translate('TOASTR.SETTINGS_NOTIFICATION'), + 'success' + ) + ); + }) } } @@ -410,4 +417,36 @@ export function getAppConfig() { .then(response => response.json()) .then(json => dispatch(getAppConfigState(json))) } +} + +export function resetAppConfig() { + return dispatch => { + return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/appconf/reset`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }) + .catch(function(error) { + console.log(error); + dispatch( + triggerToaster( + 'resetAppConfig', + 'Error', + 'error' + ) + ); + }) + .then(response => response.json()) + .then(json => { + dispatch(getAppConfig()); + dispatch( + triggerToaster( + 'Settings are reset to default', + translate('TOASTR.SETTINGS_NOTIFICATION'), + 'success' + ) + ); + }) + } } \ No newline at end of file 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/actions/storeType.js b/react/src/actions/storeType.js index 1b0527e..d00021b 100644 --- a/react/src/actions/storeType.js +++ b/react/src/actions/storeType.js @@ -42,4 +42,6 @@ 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'; +export const DISPLAY_COIND_DOWN_MODAL = 'DISPLAY_COIND_DOWN_MODAL'; \ No newline at end of file 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/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() } -
+
-
+
+
+ +
+
+
+ + + +
+ + ); +}; + +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..580f60e 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"> +
@@ -37,7 +39,7 @@ const DashboardRender = function() {
-
+
diff --git a/react/src/components/dashboard/navbar/navbar.js b/react/src/components/dashboard/navbar/navbar.js index e6b44b2..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'; @@ -81,6 +81,7 @@ class Navbar extends React.Component { ) ); Store.dispatch(logout()); + location.reload(); } openSyncOnlyModal() { 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/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index 4436cc5..3d41a4b 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, @@ -440,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' ) @@ -482,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' ) @@ -540,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' ) @@ -549,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' ) @@ -590,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/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 3d3a7a8..c1031cf 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, @@ -11,10 +11,11 @@ import { addPeerNode, getAppConfig, saveAppConfig, + resetAppConfig, getAppInfo, shepherdCli, checkForUpdateUIPromise, - updateUIPromise + updateUIPromise, } from '../../../actions/actionCreators'; import Store from '../../../store'; @@ -49,7 +50,7 @@ class Settings extends React.Component { activeTabHeight: '0', appSettings: {}, tabElId: null, - cliCmdString: null, + cliCmdString: '', cliCoin: null, cliResponse: null, exportWifKeysRaw: false, @@ -72,6 +73,7 @@ class Settings extends React.Component { this.renderPeersList = this.renderPeersList.bind(this); this.renderSNPeersList = this.renderSNPeersList.bind(this); this._saveAppConfig = this._saveAppConfig.bind(this); + this._resetAppConfig = this._resetAppConfig.bind(this); this.exportWifKeysRaw = this.exportWifKeysRaw.bind(this); this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this); this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this); @@ -97,12 +99,16 @@ class Settings extends React.Component { } } + _resetAppConfig() { + Store.dispatch(resetAppConfig()); + } + resizeLoginTextarea() { // auto-size textarea setTimeout(() => { if (this.state.seedInputVisibility) { - document.querySelector('#wifkeysPassphraseTextarea').style.height = '1px'; - document.querySelector('#wifkeysPassphraseTextarea').style.height = `${(15 + document.querySelector('#wifkeysPassphraseTextarea').scrollHeight)}px`; + document.querySelector('#wifkeysPassphraseTextarea').style.height = '1px'; + document.querySelector('#wifkeysPassphraseTextarea').style.height = `${(15 + document.querySelector('#wifkeysPassphraseTextarea').scrollHeight)}px`; } }, 100); } @@ -473,11 +479,14 @@ class Settings extends React.Component { ); } + // 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); @@ -485,44 +494,42 @@ class Settings extends React.Component { _cliResponseParsed = _cliResponse.result; } - 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; - } - - let _items = []; + if (Object.prototype.toString.call(_cliResponseParsed) === '[object Array]') { + responseType = 'array'; - 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] }
+
{ JSON.stringify(_cliResponseParsed[i], null, '\t') }
); } - } 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 { + } + if (Object.prototype.toString.call(_cliResponseParsed) === '[object]' || + typeof _cliResponseParsed === 'object') { + responseType = 'object'; + + _items.push( +
{ JSON.stringify(_cliResponseParsed, null, '\t') }
+ ); + } + if (Object.prototype.toString.call(_cliResponseParsed) === 'number' || + typeof _cliResponseParsed === 'boolean' || + _cliResponseParsed === 'wrong cli string format') { + responseType = 'number'; + + _items.push( +
{ _cliResponseParsed.toString() }
+ ); + } + + if (responseType !== 'number' && + responseType !== 'array' && + responseType !== 'object' && + _cliResponseParsed.indexOf('\n') > -1) { + _cliResponseParsed = _cliResponseParsed.split('\n'); + + for (let i = 0; i < _cliResponseParsed.length; i++) { _items.push( -
{ translate('INDEX.NO_DATA_AVAILABLE') }
+
{ _cliResponseParsed[i] }
); } } diff --git a/react/src/components/dashboard/settings/settings.render.js b/react/src/components/dashboard/settings/settings.render.js index 084bb90..5988490 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') } -

+
{ translate('SETTINGS.SAVE_APP_CONFIG') } +
@@ -570,7 +574,7 @@ export const SettingsRender = function() { name="cliCoin" id="settingsCliOptions" onChange={ this.updateInput }> - + { this.renderActiveCoinsList('native') }
- + { 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 7596576..ee734f8 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -1,8 +1,9 @@ import React from 'react'; import { translate } from '../../../translate/translate'; import { sortByDate } from '../../../util/sort'; +import { formatValue } from '../../../util/formatValue'; +import Config from '../../../config'; import { - Config, basiliskRefresh, basiliskConnection, toggleDashboardTxInfoModal, @@ -321,16 +322,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 && this.state.itemsList.length) { return TxHistoryListRender.call(this); @@ -392,6 +398,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( AddressItemRender.call(this, address, type, _amount, _coin) ); @@ -425,7 +433,11 @@ class WalletsData extends React.Component { return _addresses.public[i].amount; } else { const address = _addresses.public[i].address; - return _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 e0e6ec4..78d6bbf 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -6,6 +6,8 @@ import WalletsNotariesList from '../walletsNotariesList/walletsNotariesList'; import WalletsCacheData from '../walletsCacheData/walletsCacheData'; import ReactTable from 'react-table'; import TablePaginationRenderer from './pagination'; +import { formatValue } from '../../../util/formatValue'; +import Config from '../../../config'; // TODO: clean basilisk dropdown menu @@ -58,28 +60,36 @@ export const AddressItemRender = function(address, type, amount, coin) { }; export const AddressListRender = function() { - return ( -
- -
- + 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) { + return ( +
+ +
+ +
-
- ); + ); + } else { + return null; + } }; export const TxTypeRender = function(category) { @@ -146,7 +156,7 @@ export const WalletsDataRender = function() {
-
+
@@ -162,7 +172,7 @@ export const WalletsDataRender = function() {
{ !this.isNativeMode() ?
{ translate('INDEX.BASILISK_ACTIONS') } 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/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index af97464..acb8cb7 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -47,7 +47,58 @@ 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; + } + + 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 + ]; + } + } + renderSyncPercentagePlaceholder() { + // activating best chain + if (this.props.Dashboard.progress && + this.props.Dashboard.progress.code && + 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)); + } else { + return LoadingBlocksRender.call(this); + } + } + if (this.props.Dashboard.progress && this.props.Dashboard.progress.blocks > 0 && this.props.Dashboard.progress.longestchain === 0) { @@ -120,9 +171,30 @@ 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) { + const _blocks = this.parseActivatingBestChainProgress(); + + if (_blocks && + _blocks[0]) { + return ( + `: ${_blocks[0]} (current block)` + ); + } else { + return null; + } + } else { + if (currentProgress) { + return ( + `: ${currentProgress}% (${ translate('INDEX.RESCAN_SM') })` + ); + } else { + return null; + } + } } else if ( this.props.Settings.debugLog.indexOf('LoadExternalBlockFile:') > -1 || this.props.Settings.debugLog.indexOf('Reindexing block file') > -1 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/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/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 /> 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 diff --git a/react/src/components/overrides.scss b/react/src/components/overrides.scss index 5f7bbe8..55cd8a3 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,43 @@ select{ .navbar-brand { padding: 22px 15px; +} + +.panel-actions { + .progress { + width: inherit; + } +} + +.basilisk-actions { + .caret { + 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; + } + } + } +} + +.backround-gray { + background: #f3f4f5; } \ No newline at end of file diff --git a/react/src/config.js b/react/src/config.js index 39149ed..858ceb0 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, @@ -11,4 +12,13 @@ module.exports = { default: true }, iguanaLessMode: true, + roundValues: 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/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; } 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; 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 + ' <--'; } }