update sync/set response handling

This commit is contained in:
Akinwale Ariwodola 2019-04-17 15:42:40 +01:00
parent 5c19e56aa8
commit 8145575e25
3 changed files with 6 additions and 6 deletions

4
dist/bundle.es.js vendored
View file

@ -1984,11 +1984,11 @@ function doSetSync(oldHash, newHash, data) {
new_hash: newHash, new_hash: newHash,
data data
}, 'post').then(response => { }, 'post').then(response => {
if (!response.success) { if (!response.hash) {
return dispatch({ return dispatch({
type: SET_SYNC_FAILED, type: SET_SYNC_FAILED,
data: { data: {
error: response.error error: 'No hash returned for sync/set.'
} }
}); });
} }

4
dist/bundle.js vendored
View file

@ -3411,11 +3411,11 @@ function doSetSync(oldHash, newHash, data) {
new_hash: newHash, new_hash: newHash,
data: data data: data
}, 'post').then(function (response) { }, 'post').then(function (response) {
if (!response.success) { if (!response.hash) {
return dispatch({ return dispatch({
type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_FAILED"], type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_FAILED"],
data: { data: {
error: response.error error: 'No hash returned for sync/set.'
} }
}); });
} }

View file

@ -10,10 +10,10 @@ export function doSetSync(oldHash, newHash, data) {
Lbryio.call('sync', 'set', { old_hash: oldHash, new_hash: newHash, data }, 'post') Lbryio.call('sync', 'set', { old_hash: oldHash, new_hash: newHash, data }, 'post')
.then(response => { .then(response => {
if (!response.success) { if (!response.hash) {
return dispatch({ return dispatch({
type: ACTIONS.SET_SYNC_FAILED, type: ACTIONS.SET_SYNC_FAILED,
data: { error: response.error }, data: { error: 'No hash returned for sync/set.' },
}); });
} }