fix: state compatible
This commit is contained in:
parent
f88b8018b5
commit
6a6fe71c37
@ -21,16 +21,27 @@ const initialState = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getState = () => dispatch =>
|
const getState = () => dispatch =>
|
||||||
request.get('v1/console/server/state').then(res => {
|
request
|
||||||
dispatch({
|
.get('v1/console/server/state')
|
||||||
type: GET_STATE,
|
.then(res => {
|
||||||
data: {
|
dispatch({
|
||||||
version: res.version,
|
type: GET_STATE,
|
||||||
standaloneMode: res.standalone_mode,
|
data: {
|
||||||
functionMode: res.function_mode,
|
version: res.version,
|
||||||
},
|
standaloneMode: res.standalone_mode,
|
||||||
|
functionMode: res.function_mode,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
dispatch({
|
||||||
|
type: GET_STATE,
|
||||||
|
data: {
|
||||||
|
version: null,
|
||||||
|
functionMode: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
export default (state = initialState, action) => {
|
export default (state = initialState, action) => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user