Browse Source

added komodod is down message

all-modes
pbca26 8 years ago
parent
commit
307ccc65da
  1. 37
      react/src/actions/actions/nativeSyncInfo.js

37
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',

Loading…
Cancel
Save