mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-18 09:39:30 -07:00
auto-retry for some forecast data
This commit is contained in:
@@ -17,6 +17,7 @@ class WeatherDisplay {
|
||||
this.loadingStatus = STATUS.loading;
|
||||
this.name = name ?? elemId;
|
||||
this.getDataCallbacks = [];
|
||||
this.stillWaitingCallbacks = [];
|
||||
this.defaultEnabled = defaultEnabled;
|
||||
this.okToDrawCurrentConditions = true;
|
||||
this.okToDrawCurrentDateTime = true;
|
||||
@@ -392,6 +393,14 @@ class WeatherDisplay {
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
// still waiting for data (retries triggered)
|
||||
stillWaiting() {
|
||||
if (this.enabled) this.setStatus(STATUS.retrying);
|
||||
// handle still waiting callbacks
|
||||
this.stillWaitingCallbacks.forEach((callback) => callback());
|
||||
this.stillWaitingCallbacks = [];
|
||||
}
|
||||
}
|
||||
|
||||
export default WeatherDisplay;
|
||||
|
||||
Reference in New Issue
Block a user