diff --git a/react/src/actions/actions/nativeSyncInfo.js b/react/src/actions/actions/nativeSyncInfo.js index ee307ed..dd37de7 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -60,14 +60,25 @@ export function getSyncInfoNativeKMD(skipDebug) { } function getSyncInfoNativeState(json, coin, skipDebug) { + console.log('getSyncInfoNativeState', json); if (coin === 'KMD' && json && json.error) { return getSyncInfoNativeKMD(skipDebug); } else { - return { - type: SYNCING_NATIVE_MODE, - progress: Config.cli.default ? json.result : json, + if (json && + json.error && + Config.cli.default) { + console.log('getSyncInfoNativeState', 'error'); + return { + type: SYNCING_NATIVE_MODE, + progress: Config.cli.default ? json.error : json, + } + } else { + return { + type: SYNCING_NATIVE_MODE, + progress: Config.cli.default ? json.result : json, + } } } } @@ -134,8 +145,26 @@ export function getSyncInfoNative(coin, skipDebug) { ) ); }) - .then(response => response.json()) + .then(function(response) { + const _response = response.text().then(function(text) { return text; }); + return _response; + }) + //.then(response => response.json()) .then(json => { + if (!json && + Config.cli.default) { + dispatch( + triggerToaster( + 'Komodod is down', + 'Critical Error', + 'error', + false + ) + ); + } else { + json = JSON.parse(json); + } + dispatch(logGuiHttp({ 'timestamp': _timestamp, 'status': 'success',