🏗 Wiring up the AirDCPP settings call
This commit is contained in:
@@ -3,6 +3,7 @@ import { connectRouter } from "connected-react-router";
|
||||
import comicinfoReducer from "../reducers/comicinfo.reducer";
|
||||
import fileOpsReducer from "../reducers/fileops.reducer";
|
||||
import airdcppReducer from "../reducers/airdcpp.reducer";
|
||||
import settingsReducer from "../reducers/settings.reducer";
|
||||
import { reducer as notifications } from "react-notification-system-redux";
|
||||
|
||||
export default (history) =>
|
||||
@@ -11,5 +12,6 @@ export default (history) =>
|
||||
comicInfo: comicinfoReducer,
|
||||
fileOps: fileOpsReducer,
|
||||
airdcpp: airdcppReducer,
|
||||
settings: settingsReducer,
|
||||
router: connectRouter(history),
|
||||
});
|
||||
|
||||
30
src/client/reducers/settings.reducer.ts
Normal file
30
src/client/reducers/settings.reducer.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import {
|
||||
SETTINGS_CALL_FAILED,
|
||||
SETTINGS_OBJECT_FETCHED,
|
||||
SETTINGS_CALL_IN_PROGRESS,
|
||||
} from "../constants/action-types";
|
||||
const initialState = {
|
||||
settings: {},
|
||||
inProgress: false,
|
||||
};
|
||||
|
||||
function settingsReducer(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case SETTINGS_CALL_IN_PROGRESS:
|
||||
return {
|
||||
...state,
|
||||
inProgress: true,
|
||||
};
|
||||
|
||||
case SETTINGS_OBJECT_FETCHED:
|
||||
return {
|
||||
...state,
|
||||
data: action.data,
|
||||
};
|
||||
|
||||
default:
|
||||
return { ...state };
|
||||
}
|
||||
}
|
||||
|
||||
export default settingsReducer;
|
||||
Reference in New Issue
Block a user