Skip to content

Commit

Permalink
fix: use hourly precipitation sum
Browse files Browse the repository at this point in the history
  • Loading branch information
SegaraRai committed Jun 18, 2024
1 parent 2002056 commit 7c46806
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/widget/WeatherWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function WeatherWidget({
);

// prevent showing 0 mm or 0.0 inch precipitation
const showPrecipitation = weather.current.precipitation >= 5;
const showPrecipitation = weather.hourly.precipitation[hourlyIndex] >= 3;

const temperature = TEMPERATURE_CONVERSION_MAP[prefTemperature](
weather.current.temperature_2m
Expand All @@ -86,7 +86,7 @@ export function WeatherWidget({
hourlyIndex
].toFixed(PERCENTAGE_FRACTION_DIGITS);
const precipitation = LENGTH_CONVERSION_MAP[prefPrecipitation](
weather.current.precipitation
weather.hourly.precipitation[hourlyIndex]
).toFixed(LENGTH_FRACTION_DIGITS_MAP[prefPrecipitation]);
const windSpeed = SPEED_CONVERSION_MAP[prefWindSpeed](
weather.current.wind_speed_10m
Expand Down

0 comments on commit 7c46806

Please sign in to comment.