Skip to content

Commit

Permalink
fix: current condition not showing same min/max datas as current day …
Browse files Browse the repository at this point in the history
…in list view
  • Loading branch information
farfromrefug committed Feb 10, 2025
1 parent 811355b commit 59fd591
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,8 @@ export function prepareItems(weatherLocation: WeatherLocation, weatherData: Weat
weatherDailyData.slice(firstDailyIndex).forEach((d, index) => {
if (index === 0) {
const hours = firstHourIndex >= 0 ? weatherData.hourly.slice(firstHourIndex) : [];
const dailyData = weatherDailyData[index];
// eslint-disable-next-line prefer-const
let { cloudCeiling, cloudCover, isDay, iso, precipAccumulation, uvIndex, windGust, ...current } = dailyData;
let { cloudCeiling, cloudCover, isDay, iso, precipAccumulation, uvIndex, windGust, ...current } = d;
if (showDayDataInCurrent) {
Object.assign(current, { precipAccumulation, cloudCover, cloudCeiling, iso, uvIndex, windGust });
}
Expand All @@ -307,7 +306,7 @@ export function prepareItems(weatherLocation: WeatherLocation, weatherData: Weat
}
// sometimes current APIs might
if (!current.iconId) {
current.iconId = dailyData.iconId;
current.iconId = d.iconId;
}
// const { ...currentDaily } = current;
let min = 10000;
Expand Down

0 comments on commit 59fd591

Please sign in to comment.