mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-17 00:59:29 -07:00
fix dependency major version changes
This commit is contained in:
@@ -24,6 +24,7 @@ class CurrentWeather extends WeatherDisplay {
|
||||
stationNum += 1;
|
||||
try {
|
||||
// station observations
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
observations = await utils.fetch.json(`${station.id}/observations`, {
|
||||
cors: true,
|
||||
data: {
|
||||
@@ -38,8 +39,6 @@ class CurrentWeather extends WeatherDisplay {
|
||||
observations = undefined;
|
||||
throw new Error(`Unable to get observations: ${station.properties.stationIdentifier}, trying next station`);
|
||||
}
|
||||
|
||||
// TODO: add retry for further stations if observations are unavailable
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
@@ -152,8 +152,9 @@ class Radar extends WeatherDisplay {
|
||||
day,
|
||||
hour,
|
||||
minute,
|
||||
}, {
|
||||
zone: 'UTC',
|
||||
}).setZone();
|
||||
});
|
||||
} else {
|
||||
time = DateTime.fromHTTP(response.headers.get('last-modified')).setZone();
|
||||
}
|
||||
|
||||
@@ -256,8 +256,8 @@ const utils = (() => {
|
||||
let corsUrl = _url;
|
||||
if (params.cors === true) corsUrl = rewriteUrl(_url);
|
||||
const url = new URL(corsUrl);
|
||||
// force url to secure
|
||||
url.protocol = 'https:';
|
||||
// match the security protocol
|
||||
url.protocol = window.location.protocol;
|
||||
// add parameters if necessary
|
||||
if (params.data) {
|
||||
Object.keys(params.data).forEach((key) => {
|
||||
|
||||
Reference in New Issue
Block a user