Browse Source

kmd passive disable daemon down modal; switch toaster message

all-modes
pbca26 7 years ago
parent
commit
7cac689a95
  1. 33
      react/src/actions/actions/nativeSyncInfo.js
  2. 17
      react/src/components/dashboard/coindDownModal/coindDownModal.js
  3. 2
      react/src/components/dashboard/importKeyModal/importKeyModal.js

33
react/src/actions/actions/nativeSyncInfo.js

@ -149,14 +149,31 @@ export function getSyncInfoNative(coin, skipDebug, skipRemote, suppressErrors) {
} else {
if (!json &&
Config.cli.default) {
dispatch(
triggerToaster(
'Komodod is down',
'Critical Error',
'error',
true
)
);
let _kmdMainPassiveMode;
try {
_kmdMainPassiveMode = window.require('electron').remote.getCurrentWindow().kmdMainPassiveMode;
} catch (e) {}
if (!_kmdMainPassiveMode) {
dispatch(
triggerToaster(
'Komodod is down',
'Critical Error',
'error',
true
)
);
} else {
dispatch(
triggerToaster(
'Please make sure to run komodod manually',
'Connection error',
'warning',
true
)
);
}
if (coin === 'KMD') {
dispatch(getDebugLog('komodo', 50));

17
react/src/components/dashboard/coindDownModal/coindDownModal.js

@ -11,6 +11,7 @@ class CoindDownModal extends React.Component {
this.state = {
display: false,
debugLogCrash: null,
kmdMainPassiveMode: false,
};
this.dismiss = this.dismiss.bind(this);
}
@ -19,6 +20,18 @@ class CoindDownModal extends React.Component {
Store.dispatch(toggleCoindDownModal(false));
}
componentWillMount() {
let _kmdMainPassiveMode;
try {
_kmdMainPassiveMode = window.require('electron').remote.getCurrentWindow().kmdMainPassiveMode;
} catch (e) {}
this.setState(Object.assign({}, this.state, {
kmdMainPassiveMode: _kmdMainPassiveMode,
}));
}
componentWillReceiveProps(nextProps) {
if (this.props.displayCoindDownModal !== nextProps.displayCoindDownModal) {
this.setState(Object.assign({}, this.state, {
@ -28,13 +41,15 @@ class CoindDownModal extends React.Component {
}
render() {
if (this.state.display) {
if (this.state.display &&
!this.state.kmdMainPassiveMode) {
return CoindDownModalRender.call(this);
}
return null;
}
}
const mapStateToProps = (state) => {
return {
ActiveCoin: {

2
react/src/components/dashboard/importKeyModal/importKeyModal.js

@ -142,7 +142,7 @@ class ImportKeyModal extends React.Component {
Store.dispatch(getDashboardUpdateState(null, this.props.ActiveCoin.coin, true));
Store.dispatch(
triggerToaster(
'Address imported. Wallet rescan is in progress. Please wait until it\s finished.',
'Address imported. Wallet rescan is in progress. Please wait until it is finished.',
translate('TOASTR.WALLET_NOTIFICATION'),
'info',
false

Loading…
Cancel
Save