mirror of
https://github.com/plankanban/planka.git
synced 2025-12-19 17:23:27 +03:00
35 lines
790 B
JavaScript
35 lines
790 B
JavaScript
|
|
import ActionTypes from '../constants/ActionTypes';
|
||
|
|
|
||
|
|
const initialState = {
|
||
|
|
isInitializing: true,
|
||
|
|
config: null,
|
||
|
|
};
|
||
|
|
|
||
|
|
// eslint-disable-next-line default-param-last
|
||
|
|
export default (state = initialState, { type, payload }) => {
|
||
|
|
switch (type) {
|
||
|
|
case ActionTypes.LOGIN_INITIALIZE:
|
||
|
|
return {
|
||
|
|
...state,
|
||
|
|
isInitializing: false,
|
||
|
|
config: payload.config,
|
||
|
|
};
|
||
|
|
case ActionTypes.AUTHENTICATE__SUCCESS:
|
||
|
|
case ActionTypes.WITH_OIDC_AUTHENTICATE__SUCCESS:
|
||
|
|
return {
|
||
|
|
...state,
|
||
|
|
isInitializing: true,
|
||
|
|
};
|
||
|
|
case ActionTypes.CORE_INITIALIZE:
|
||
|
|
return {
|
||
|
|
...state,
|
||
|
|
isInitializing: false,
|
||
|
|
...(payload.config && {
|
||
|
|
config: payload.config,
|
||
|
|
}),
|
||
|
|
};
|
||
|
|
default:
|
||
|
|
return state;
|
||
|
|
}
|
||
|
|
};
|