mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-22 11:39:30 -07:00
skip spc outlook if not in the next 3 days
This commit is contained in:
@@ -41,6 +41,8 @@ const barSizes = {
|
|||||||
class SpcOutlook extends WeatherDisplay {
|
class SpcOutlook extends WeatherDisplay {
|
||||||
constructor(navId, elemId) {
|
constructor(navId, elemId) {
|
||||||
super(navId, elemId, 'SPC Outlook', true);
|
super(navId, elemId, 'SPC Outlook', true);
|
||||||
|
// don't display on progress/navigation screen
|
||||||
|
this.showOnProgress = false;
|
||||||
|
|
||||||
// calculate file names
|
// calculate file names
|
||||||
this.files = [null, null, null].map((v, i) => urlPattern(i + 1));
|
this.files = [null, null, null].map((v, i) => urlPattern(i + 1));
|
||||||
@@ -70,6 +72,14 @@ class SpcOutlook extends WeatherDisplay {
|
|||||||
// do the initial parsing of the data
|
// do the initial parsing of the data
|
||||||
this.data = testAllPoints([weatherParameters.longitude, weatherParameters.latitude], initialData);
|
this.data = testAllPoints([weatherParameters.longitude, weatherParameters.latitude], initialData);
|
||||||
|
|
||||||
|
// if all the data returns false the there's nothing to do, skip this screen
|
||||||
|
if (this.data.reduce((prev, cur) => prev || !!cur, false)) {
|
||||||
|
this.timing.totalScreens = 1;
|
||||||
|
} else {
|
||||||
|
this.timing.totalScreens = 0;
|
||||||
|
}
|
||||||
|
this.calcNavTiming();
|
||||||
|
|
||||||
// we only get here if there was no error above
|
// we only get here if there was no error above
|
||||||
this.screenIndex = 0;
|
this.screenIndex = 0;
|
||||||
this.setStatus(STATUS.loaded);
|
this.setStatus(STATUS.loaded);
|
||||||
|
|||||||
Reference in New Issue
Block a user