add download canceled to the file_info reducer

This commit is contained in:
Akinwale Ariwodola 2018-10-22 13:03:02 +01:00
parent 4ee6c376e5
commit 22519cfc42
2 changed files with 23 additions and 0 deletions

12
dist/bundle.js vendored
View file

@ -5469,6 +5469,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

@ -85,6 +85,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;