Skip to content

Commit dee26f4

Browse files
committed
Typing and fixed load init data
1 parent d331401 commit dee26f4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/actions/components.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,15 @@ export const changeImagePath = (imageSource: string) => ({
3939
})
4040

4141
export const loadInitData = () => (dispatch: (arg: Action) => void) => {
42-
loadState().then((data: any) => dispatch({
42+
loadState().then((data: any) => {
43+
dispatch({
4344
type: LOAD_INIT_DATA,
4445
payload: {
4546
data: data ? data.workspace : {},
4647
},
47-
}));
48+
});
49+
console.log(data);
50+
});
4851
};
4952

5053
export const addComponent = ({ title }: { title: string }) => (dispatch: (arg: Action) => void) => {

src/containers/AppContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import LinearProgress from '@material-ui/core/LinearProgress';
55
import LeftContainer from './LeftContainer.tsx';
66
import MainContainer from './MainContainer.tsx';
77
import theme from '../components/theme.ts';
8-
import { loadInitData } from '../actions/components.ts';
8+
// import { loadInitData } from '../actions/components.ts';
99
import { ComponentInt, ComponentsInt } from '../utils/Interfaces.ts';
1010
import * as actions from '../actions/components';
1111

@@ -40,7 +40,7 @@ const mapStateToProps = (store: any) => ({
4040
});
4141

4242
const mapDispatchToProps = (dispatch: any) => ({
43-
loadInitData,
43+
loadInitData: () => dispatch(actions.loadInitData()),
4444
changeImagePath: (imageSource: string) => dispatch(actions.changeImagePath(imageSource)),
4545
});
4646

0 commit comments

Comments
 (0)