diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec6d9e5e..082de65c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,7 @@ on: paths: - "**.js" - "**.ts" + - "**.tsx" - "**.test.ts" - "**.json" - "**.yml" @@ -17,6 +18,7 @@ on: paths: - "**.js" - "**.ts" + - "**.tsx" - "**.test.ts" - "**.json" - "**.yml" diff --git a/src/display/components/weather/conditions.tsx b/src/display/components/weather/conditions.tsx index 426bd191..b2a72786 100644 --- a/src/display/components/weather/conditions.tsx +++ b/src/display/components/weather/conditions.tsx @@ -49,16 +49,16 @@ export function Conditions(props: ConditionsProp) { ); const formattedWind = useMemo(() => { + // handle "calm" or wind less than 2kmh + if (!windSpeedValue || windSpeedValue === CONDITIONS_WIND_SPEED_CALM || Number(windSpeedValue) < 2) + return CONDITIONS_WIND_SPEED_CALM; + const speed = windSpeedValue ?? ""; const direction = windDirection.padStart(3); - // gust is a different format + // gust is a different format (omits units) if (windGust) return `${direction} ${speed}G${windGust.value} `; - // handle "calm" or wind less than 2kmh - if (!windSpeedValue || windSpeedValue === CONDITIONS_WIND_SPEED_CALM || Number(windSpeedValue) < 2) - return CONDITIONS_WIND_SPEED_CALM.padEnd(11); - return `${direction}${`${speed} KMH`.padStart(8)}`; }, [observedDateTime]);