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) => { | ||||
|   var tutorialsStatus = getState().tutorial.status; | ||||
|   var id = getState().tutorial.currentId; | ||||
|   if(id){ | ||||
|   if(id !== null){ | ||||
|     var tutorialsStatus = getState().tutorial.status; | ||||
|     tutorialsStatus[id] = {...tutorialsStatus[id], xml: code}; | ||||
|     dispatch({ | ||||
|       type: TUTORIAL_XML, | ||||
|  | ||||
| @ -39,7 +39,7 @@ class ClearWorkspace extends Component { | ||||
| 
 | ||||
| ClearWorkspace.propTypes = { | ||||
|   clearStats: PropTypes.func.isRequired, | ||||
|   onChangeWorkspace: PropTypes.func.isRequired | ||||
|   onChangeCode: PropTypes.func.isRequired | ||||
| }; | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -100,7 +100,7 @@ class Tutorial extends Component { | ||||
| 
 | ||||
| Tutorial.propTypes = { | ||||
|   tutorialId: PropTypes.func.isRequired, | ||||
|   currentTutorialId: PropTypes.number.isRequired, | ||||
|   currentTutorialId: PropTypes.number, | ||||
|   status: PropTypes.array.isRequired, | ||||
|   change: PropTypes.number.isRequired | ||||
| }; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user