Merge pull request #57 from lbryio/fileinfo-errors

add error handling for file info
This commit is contained in:
Sean Yesmunt 2018-07-19 09:56:42 -04:00 committed by GitHub
commit e0909b0864
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 6 deletions

17
dist/bundle.js vendored
View file

@ -5228,6 +5228,9 @@ function costInfoReducer() {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.fileInfoReducer = fileInfoReducer;
var _action_types = __webpack_require__(4);
@ -5374,11 +5377,14 @@ reducers[ACTIONS.LOADING_VIDEO_STARTED] = function (state, action) {
var newLoading = Object.assign({}, state.urisLoading);
newLoading[uri] = true;
var newErrors = _extends({}, state.errors);
if (uri in newErrors) delete newErrors[uri];
return Object.assign({}, state, {
urisLoading: newLoading
urisLoading: newLoading,
errors: _extends({}, newErrors)
});
};
@ -5387,11 +5393,14 @@ reducers[ACTIONS.LOADING_VIDEO_FAILED] = function (state, action) {
var newLoading = Object.assign({}, state.urisLoading);
delete newLoading[uri];
var newErrors = _extends({}, state.errors);
newErrors[uri] = true;
return Object.assign({}, state, {
urisLoading: newLoading
urisLoading: newLoading,
errors: _extends({}, newErrors)
});
};

View file

@ -119,11 +119,14 @@ reducers[ACTIONS.LOADING_VIDEO_STARTED] = (state, action) => {
const { uri } = action.data;
const newLoading = Object.assign({}, state.urisLoading);
newLoading[uri] = true;
const newErrors = { ...state.errors };
if (uri in newErrors) delete newErrors[uri];
return Object.assign({}, state, {
urisLoading: newLoading,
errors: { ...newErrors },
});
};
@ -131,11 +134,14 @@ reducers[ACTIONS.LOADING_VIDEO_FAILED] = (state, action) => {
const { uri } = action.data;
const newLoading = Object.assign({}, state.urisLoading);
delete newLoading[uri];
const newErrors = { ...state.errors };
newErrors[uri] = true;
return Object.assign({}, state, {
urisLoading: newLoading,
errors: { ...newErrors },
});
};