mirror of https://github.com/espruino/BangleApps
weather: make expiry default to 2 hours
parent
2cb595300e
commit
60b4fc3351
|
@ -6,8 +6,9 @@ function scheduleExpiry(json) {
|
||||||
clearTimeout(expiryTimeout);
|
clearTimeout(expiryTimeout);
|
||||||
expiryTimeout = undefined;
|
expiryTimeout = undefined;
|
||||||
}
|
}
|
||||||
if (json.weather && json.weather.time && json.expiry) {
|
let expiry = "expiry" in json ? json.expiry : 2*3600000;
|
||||||
let t = json.weather.time + json.expiry - Date.now();
|
if (json.weather && json.weather.time && expiry) {
|
||||||
|
let t = json.weather.time + expiry - Date.now();
|
||||||
expiryTimeout = setTimeout(() => {
|
expiryTimeout = setTimeout(() => {
|
||||||
expiryTimeout = undefined;
|
expiryTimeout = undefined;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue