🏗 Actions, reducers for Downloads

This commit is contained in:
2022-06-13 14:56:15 -07:00
parent 15c0840c63
commit 7a3e0def34
6 changed files with 29 additions and 30 deletions

View File

@@ -7,6 +7,7 @@ import {
AIRDCPP_DOWNLOAD_PROGRESS_TICK,
AIRDCPP_FILE_DOWNLOAD_COMPLETED,
AIRDCPP_BUNDLES_FETCHED,
AIRDCPP_TRANSFERS_FETCHED,
} from "../constants/action-types";
import { LOCATION_CHANGE } from "redux-first-history";
import { isUndefined } from "lodash";
@@ -21,6 +22,7 @@ const initialState = {
bundleDBImportResult: null,
downloadFileStatus: {},
bundles: [],
transfers: [],
};
function airdcppReducer(state = initialState, action) {
@@ -81,6 +83,11 @@ function airdcppReducer(state = initialState, action) {
return {
...state,
};
case AIRDCPP_TRANSFERS_FETCHED:
return {
...state,
transfers: action.transfers,
};
case LOCATION_CHANGE:
return {
searchResults: [],