mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-18 09:39:30 -07:00
timing cleanup
This commit is contained in:
@@ -422,8 +422,10 @@ class WeatherDisplay {
|
||||
|
||||
// get the screen index for the current base count, returns false if past end of timing array (go to next screen, stop timing)
|
||||
screenIndexFromBaseCount() {
|
||||
// test for timing enabled
|
||||
if (!this.timing) return 0;
|
||||
// find the first timing in the timing array that is greater than the base count
|
||||
if (!this.timing.fullDelay) this.calcNavTiming();
|
||||
if (this.timing && !this.timing.fullDelay) this.calcNavTiming();
|
||||
const timingIndex = this.timing.fullDelay.findIndex(delay => delay > this.navBaseCount);
|
||||
if (timingIndex === -1) return false;
|
||||
return this.timing.screenIndexes[timingIndex];
|
||||
|
||||
Reference in New Issue
Block a user