Added polling for watcher.
This commit is contained in:
@@ -38,3 +38,7 @@ export const setSelectedJobTargetPcSuccess = (pct) => ({
|
||||
type: ApplicationActionTypes.SET_SELECTED_JOB_TARGET_PC_SUCCESS,
|
||||
payload: pct,
|
||||
});
|
||||
export const setSettings = (settingsObj) => ({
|
||||
type: ApplicationActionTypes.SET_SETTINGS,
|
||||
payload: settingsObj,
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ const INITIAL_STATE = {
|
||||
watcherError: null,
|
||||
selectedJobId: null,
|
||||
selectedJobTargetPc: 100,
|
||||
settings: {},
|
||||
};
|
||||
|
||||
const applicationReducer = (state = INITIAL_STATE, action) => {
|
||||
@@ -41,6 +42,9 @@ const applicationReducer = (state = INITIAL_STATE, action) => {
|
||||
};
|
||||
case ApplicationActionTypes.SET_SELECTED_JOB_ID:
|
||||
return { ...state, selectedJobId: action.payload };
|
||||
case ApplicationActionTypes.SET_SETTINGS:
|
||||
return { ...state, settings: { ...state.settings, ...action.payload } };
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -26,3 +26,8 @@ export const selectSelectedJobTargetPc = createSelector(
|
||||
[selectApplication],
|
||||
(application) => application.selectedJobTargetPc
|
||||
);
|
||||
|
||||
export const selectSettings = createSelector(
|
||||
[selectApplication],
|
||||
(application) => application.settings
|
||||
);
|
||||
|
||||
@@ -7,5 +7,6 @@ const ApplicationActionTypes = {
|
||||
SET_SELECTED_JOB_ID: "SET_SELECTED_JOB_ID",
|
||||
SET_SELECTED_JOB_TARGET_PC: "SET_SELECTED_JOB_TARGET_PC",
|
||||
SET_SELECTED_JOB_TARGET_PC_SUCCESS: "SET_SELECTED_JOB_TARGET_PC_SUCCESS",
|
||||
SET_SETTINGS: "SET_SETTINGS",
|
||||
};
|
||||
export default ApplicationActionTypes;
|
||||
|
||||
Reference in New Issue
Block a user