close #13 refresh page at end of loop
This commit is contained in:
		
							parent
							
								
									0724e68423
								
							
						
					
					
						commit
						7986b04615
					
				
					 2 changed files with 15 additions and 1 deletions
				
			
		| 
						 | 
					@ -465,7 +465,7 @@ const index = (() => {
 | 
				
			||||||
			document.getElementById('spanRefreshCountDown').innerHTML = `${dt.getMinutes() < 10 ? `0${dt.getMinutes()}` : dt.getMinutes()}:${dt.getSeconds() < 10 ? `0${dt.getSeconds()}` : dt.getSeconds()}`;
 | 
								document.getElementById('spanRefreshCountDown').innerHTML = `${dt.getMinutes() < 10 ? `0${dt.getMinutes()}` : dt.getMinutes()}:${dt.getSeconds() < 10 ? `0${dt.getSeconds()}` : dt.getSeconds()}`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Time has elapsed.
 | 
								// Time has elapsed.
 | 
				
			||||||
			if (AutoRefreshCountMs >= AutoRefreshTotalIntervalMs) LoadTwcData();
 | 
								if (AutoRefreshCountMs >= AutoRefreshTotalIntervalMs && !navigation.isPlaying()) LoadTwcData();
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
		AutoRefreshIntervalId = window.setInterval(AutoRefreshTimer, AutoRefreshIntervalMs);
 | 
							AutoRefreshIntervalId = window.setInterval(AutoRefreshTimer, AutoRefreshIntervalMs);
 | 
				
			||||||
		AutoRefreshTimer();
 | 
							AutoRefreshTimer();
 | 
				
			||||||
| 
						 | 
					@ -537,8 +537,18 @@ const index = (() => {
 | 
				
			||||||
		return noSleep.controller.disable();
 | 
							return noSleep.controller.disable();
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						const refreshCheck = () => {
 | 
				
			||||||
 | 
							// Time has elapsed.
 | 
				
			||||||
 | 
							if (AutoRefreshCountMs >= AutoRefreshTotalIntervalMs) {
 | 
				
			||||||
 | 
								LoadTwcData();
 | 
				
			||||||
 | 
								return true;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return {
 | 
						return {
 | 
				
			||||||
		init,
 | 
							init,
 | 
				
			||||||
		message,
 | 
							message,
 | 
				
			||||||
 | 
							refreshCheck,
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
})();
 | 
					})();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -203,6 +203,10 @@ const navigation = (() => {
 | 
				
			||||||
			idx = utils.calc.wrap(curIdx + (i + 1) * direction, totalDisplays);
 | 
								idx = utils.calc.wrap(curIdx + (i + 1) * direction, totalDisplays);
 | 
				
			||||||
			if (displays[idx].status === STATUS.loaded) break;
 | 
								if (displays[idx].status === STATUS.loaded) break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							// if new display index is less than current display a wrap occurred, test for reload timeout
 | 
				
			||||||
 | 
							if (idx <= curIdx) {
 | 
				
			||||||
 | 
								if (index.refreshCheck()) return;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		const newDisplay = displays[idx];
 | 
							const newDisplay = displays[idx];
 | 
				
			||||||
		// hide all displays
 | 
							// hide all displays
 | 
				
			||||||
		hideAllCanvases();
 | 
							hideAllCanvases();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue