auto-retry for some forecast data
This commit is contained in:
parent
76fd93e6e1
commit
5dd8f4bd62
16 changed files with 101 additions and 36 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue