remove additional jquery ajax requests
This commit is contained in:
parent
5a766a809d
commit
456af1b09a
11 changed files with 86 additions and 124 deletions
|
|
@ -35,11 +35,7 @@ class TravelForecast extends WeatherDisplay {
|
|||
try {
|
||||
// get point then forecast
|
||||
const point = await utils.weather.getPoint(city.Latitude, city.Longitude);
|
||||
const forecast = await $.ajax({
|
||||
url: point.properties.forecast,
|
||||
dataType: 'json',
|
||||
crossDomain: true,
|
||||
});
|
||||
const forecast = await utils.fetch.json(point.properties.forecast);
|
||||
// determine today or tomorrow (shift periods by 1 if tomorrow)
|
||||
const todayShift = forecast.properties.periods[0].isDaytime? 0:1;
|
||||
// return a pared-down forecast
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue