planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

38
node_modules/decap-cms-core/src/reducers/config.ts generated vendored Normal file
View File

@@ -0,0 +1,38 @@
import { produce } from 'immer';
import { CONFIG_REQUEST, CONFIG_SUCCESS, CONFIG_FAILURE } from '../actions/config';
import { EDITORIAL_WORKFLOW } from '../constants/publishModes';
import type { ConfigAction } from '../actions/config';
import type { CmsConfig } from '../types/redux';
const defaultState = {
isFetching: true,
};
const config = produce((state: CmsConfig, action: ConfigAction) => {
switch (action.type) {
case CONFIG_REQUEST:
state.isFetching = true;
break;
case CONFIG_SUCCESS:
return {
...action.payload,
isFetching: false,
error: undefined,
};
case CONFIG_FAILURE:
state.isFetching = false;
state.error = action.payload.toString();
}
}, defaultState);
export function selectLocale(state: CmsConfig) {
return state.locale || 'en';
}
export function selectUseWorkflow(state: CmsConfig) {
return state.publish_mode === EDITORIAL_WORKFLOW;
}
export default config;