Browse Source

proper rpc getinfo con failure handling; disable coind down modal

v0.25
pbca26 7 years ago
parent
commit
443fca800d
  1. 11
      react/src/actions/actions/nativeSyncInfo.js

11
react/src/actions/actions/nativeSyncInfo.js

@ -5,7 +5,6 @@ import {
import { import {
triggerToaster, triggerToaster,
getDebugLog, getDebugLog,
toggleCoindDownModal
} from '../actionCreators'; } from '../actionCreators';
import Config from '../../config'; import Config from '../../config';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
@ -138,7 +137,7 @@ export function getSyncInfoNative(coin, skipDebug, skipRemote, suppressErrors) {
{ {
result: 'daemon is busy', result: 'daemon is busy',
error: null, error: null,
id: null id: null,
}, },
coin, coin,
true, true,
@ -146,16 +145,15 @@ export function getSyncInfoNative(coin, skipDebug, skipRemote, suppressErrors) {
) )
); );
} else { } else {
if (!json) { if (!json ||
json.indexOf('"code":-777') > -1) {
let _kmdMainPassiveMode; let _kmdMainPassiveMode;
try { try {
_kmdMainPassiveMode = window.require('electron').remote.getCurrentWindow().kmdMainPassiveMode; _kmdMainPassiveMode = window.require('electron').remote.getCurrentWindow().kmdMainPassiveMode;
} catch (e) {} } catch (e) {}
if (!_kmdMainPassiveMode) { if (_kmdMainPassiveMode) {
dispatch(nativeGetinfoFailureState());
} else {
dispatch( dispatch(
triggerToaster( triggerToaster(
translate('API.KMD_PASSIVE_ERROR'), translate('API.KMD_PASSIVE_ERROR'),
@ -171,7 +169,6 @@ export function getSyncInfoNative(coin, skipDebug, skipRemote, suppressErrors) {
} else { } else {
dispatch(getDebugLog('komodo', 50, coin)); dispatch(getDebugLog('komodo', 50, coin));
} }
dispatch(toggleCoindDownModal(true));
} else { } else {
json = JSON.parse(json); json = JSON.parse(json);
} }

Loading…
Cancel
Save