own blocklyWindow for an instruction

This commit is contained in:
Delucse
2020-09-09 13:36:41 +02:00
parent 2908bc464f
commit f14508a5ca
6 changed files with 115 additions and 18 deletions
+7 -1
View File
@@ -1,4 +1,4 @@
import { TUTORIAL_SUCCESS, TUTORIAL_ERROR, TUTORIAL_CHANGE, TUTORIAL_XML, TUTORIAL_ID } from '../actions/types';
import { TUTORIAL_SUCCESS, TUTORIAL_ERROR, TUTORIAL_CHANGE, TUTORIAL_XML, TUTORIAL_ID, TUTORIAL_LEVEL } from '../actions/types';
import { tutorials } from '../components/Tutorial/tutorials';
@@ -6,6 +6,7 @@ const initialState = {
status: window.localStorage.getItem('tutorial') ?
JSON.parse(window.localStorage.getItem('tutorial'))
: new Array(tutorials.length).fill({}),
level: 'instruction',
currentId: null,
change: 0
};
@@ -31,6 +32,11 @@ export default function(state = initialState, action){
...state,
currentId: action.payload
}
case TUTORIAL_LEVEL:
return {
...state,
level: action.payload
}
default:
return state;
}