From 0029f7cc2619b0eacfa0a8ba707caf9847353d7c Mon Sep 17 00:00:00 2001 From: Delucse <46593742+Delucse@users.noreply.github.com> Date: Sun, 20 Sep 2020 16:45:24 +0200 Subject: [PATCH] another way to initialize an array to fix bug --- src/actions/tutorialBuilderActions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/actions/tutorialBuilderActions.js b/src/actions/tutorialBuilderActions.js index 3925e41..48d4bc2 100644 --- a/src/actions/tutorialBuilderActions.js +++ b/src/actions/tutorialBuilderActions.js @@ -243,10 +243,11 @@ export const resetTutorial = () => (dispatch, getState) => { export const readJSON = (json) => (dispatch, getState) => { dispatch(resetTutorial()); + console.log(json.steps.map(() => {return {};})); dispatch({ type: BUILDER_ERROR, payload: { - steps: new Array(json.steps.length).fill({}) + steps: json.steps.map(() => {return {};}) } }); dispatch(tutorialTitle(json.title));