another way to initialize an array to fix bug
This commit is contained in:
parent
420477e02c
commit
0029f7cc26
@ -243,10 +243,11 @@ export const resetTutorial = () => (dispatch, getState) => {
|
|||||||
|
|
||||||
export const readJSON = (json) => (dispatch, getState) => {
|
export const readJSON = (json) => (dispatch, getState) => {
|
||||||
dispatch(resetTutorial());
|
dispatch(resetTutorial());
|
||||||
|
console.log(json.steps.map(() => {return {};}));
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BUILDER_ERROR,
|
type: BUILDER_ERROR,
|
||||||
payload: {
|
payload: {
|
||||||
steps: new Array(json.steps.length).fill({})
|
steps: json.steps.map(() => {return {};})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dispatch(tutorialTitle(json.title));
|
dispatch(tutorialTitle(json.title));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user