store only xml if tutorial-id exists
This commit is contained in:
parent
eea893a071
commit
4f34811a94
@ -18,9 +18,9 @@ export const tutorialCheck = (status) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const storeTutorialXml = (code) => (dispatch, getState) => {
|
export const storeTutorialXml = (code) => (dispatch, getState) => {
|
||||||
var tutorialsStatus = getState().tutorial.status;
|
|
||||||
var id = getState().tutorial.currentId;
|
var id = getState().tutorial.currentId;
|
||||||
if(id){
|
if(id !== null){
|
||||||
|
var tutorialsStatus = getState().tutorial.status;
|
||||||
tutorialsStatus[id] = {...tutorialsStatus[id], xml: code};
|
tutorialsStatus[id] = {...tutorialsStatus[id], xml: code};
|
||||||
dispatch({
|
dispatch({
|
||||||
type: TUTORIAL_XML,
|
type: TUTORIAL_XML,
|
||||||
|
@ -39,7 +39,7 @@ class ClearWorkspace extends Component {
|
|||||||
|
|
||||||
ClearWorkspace.propTypes = {
|
ClearWorkspace.propTypes = {
|
||||||
clearStats: PropTypes.func.isRequired,
|
clearStats: PropTypes.func.isRequired,
|
||||||
onChangeWorkspace: PropTypes.func.isRequired
|
onChangeCode: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ class Tutorial extends Component {
|
|||||||
|
|
||||||
Tutorial.propTypes = {
|
Tutorial.propTypes = {
|
||||||
tutorialId: PropTypes.func.isRequired,
|
tutorialId: PropTypes.func.isRequired,
|
||||||
currentTutorialId: PropTypes.number.isRequired,
|
currentTutorialId: PropTypes.number,
|
||||||
status: PropTypes.array.isRequired,
|
status: PropTypes.array.isRequired,
|
||||||
change: PropTypes.number.isRequired
|
change: PropTypes.number.isRequired
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user