Merge pull request #86 from lbryio/download-canceled

add download canceled to the file_info reducer
This commit is contained in:
Akinwale Ariwodola 2018-10-23 15:53:54 +01:00 committed by GitHub
commit 997027fae2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

12
dist/bundle.js vendored
View file

@ -5571,6 +5571,18 @@ reducers[ACTIONS.DOWNLOADING_PROGRESSED] = function (state, action) {
});
};
reducers[ACTIONS.DOWNLOADING_CANCELED] = function (state, action) {
var outpoint = action.data.outpoint;
var newDownloading = Object.assign({}, state.downloadingByOutpoint);
delete newDownloading[outpoint];
return Object.assign({}, state, {
downloadingByOutpoint: newDownloading
});
};
reducers[ACTIONS.DOWNLOADING_COMPLETED] = function (state, action) {
var _action$data4 = action.data,
outpoint = _action$data4.outpoint,

View file

@ -88,6 +88,17 @@ reducers[ACTIONS.DOWNLOADING_PROGRESSED] = (state, action) => {
});
};
reducers[ACTIONS.DOWNLOADING_CANCELED] = (state, action) => {
const { outpoint } = action.data;
const newDownloading = Object.assign({}, state.downloadingByOutpoint);
delete newDownloading[outpoint];
return Object.assign({}, state, {
downloadingByOutpoint: newDownloading,
});
};
reducers[ACTIONS.DOWNLOADING_COMPLETED] = (state, action) => {
const { outpoint, fileInfo } = action.data;