🔧 AirDCPP UI integration
This commit is contained in:
34
src/client/reducers/airdcpp.reducer.ts
Normal file
34
src/client/reducers/airdcpp.reducer.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import {
|
||||
AIRDCPP_SEARCH_INSTANCE_CREATED,
|
||||
AIRDCPP_SEARCH_IN_PROGRESS,
|
||||
AIRDCPP_SEARCH_RESULTS_RECEIVED,
|
||||
} from "../constants/action-types";
|
||||
|
||||
const initialState = {
|
||||
isAirDCPPSearchInProgress: false,
|
||||
};
|
||||
|
||||
function airdcppReducer(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case AIRDCPP_SEARCH_INSTANCE_CREATED:
|
||||
return {
|
||||
...state,
|
||||
searchInstance: action.searchInstance,
|
||||
};
|
||||
|
||||
case AIRDCPP_SEARCH_IN_PROGRESS:
|
||||
return {
|
||||
...state,
|
||||
isAirDCPPSearchInProgress: true,
|
||||
};
|
||||
|
||||
case AIRDCPP_SEARCH_RESULTS_RECEIVED:
|
||||
return {
|
||||
...state,
|
||||
isAirDCPPSearchInProgress: false,
|
||||
results: action.results,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export default airdcppReducer;
|
||||
Reference in New Issue
Block a user