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/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/actions/settings.js b/react/src/actions/actions/settings.js index e1aacb7..126f10b 100644 --- a/react/src/actions/actions/settings.js +++ b/react/src/actions/actions/settings.js @@ -376,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' + ) + ); + }) } } @@ -408,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/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/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/settings/settings.js b/react/src/components/dashboard/settings/settings.js index 109f936..c1031cf 100644 --- a/react/src/components/dashboard/settings/settings.js +++ b/react/src/components/dashboard/settings/settings.js @@ -11,10 +11,11 @@ import { addPeerNode, getAppConfig, saveAppConfig, + resetAppConfig, getAppInfo, shepherdCli, checkForUpdateUIPromise, - updateUIPromise + updateUIPromise, } from '../../../actions/actionCreators'; import Store from '../../../store'; @@ -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); } diff --git a/react/src/components/dashboard/settings/settings.render.js b/react/src/components/dashboard/settings/settings.render.js index 47d4fd4..5988490 100644 --- a/react/src/components/dashboard/settings/settings.render.js +++ b/react/src/components/dashboard/settings/settings.render.js @@ -538,6 +538,10 @@ export const SettingsRender = function() { type="button" className="btn btn-primary waves-effect waves-light" onClick={ this._saveAppConfig }>{ translate('SETTINGS.SAVE_APP_CONFIG') } +
@@ -570,7 +574,7 @@ export const SettingsRender = function() { name="cliCoin" id="settingsCliOptions" onChange={ this.updateInput }> - + { this.renderActiveCoinsList('native') }