Improve promise handling
This commit is contained in:
		
							parent
							
								
									2aa147060a
								
							
						
					
					
						commit
						5c95dec36d
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -316,9 +316,11 @@ function refresh() {
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return response.json()
 | 
							return response.json()
 | 
				
			||||||
	}).then(function (response) {
 | 
						}).then(function (response) {
 | 
				
			||||||
 | 
							if (!response) {
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		trainData = response
 | 
							trainData = response
 | 
				
			||||||
		onTrainData(response)
 | 
							onTrainData(response)
 | 
				
			||||||
	}).then(function () {
 | 
					 | 
				
			||||||
		reschedule()
 | 
							reschedule()
 | 
				
			||||||
	}).catch(function (e) {
 | 
						}).catch(function (e) {
 | 
				
			||||||
		// Check in 1 second if network error
 | 
							// Check in 1 second if network error
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue