prevent fog conditions from generating unsupported wind icons
This commit is contained in:
parent
2e97e3746b
commit
8880fc2f10
2 changed files with 3 additions and 6 deletions
|
|
@ -55,12 +55,9 @@ const getSmallIconFromWmoCode = (code, isDaytime = true) => smallIcon(buildSynth
|
||||||
const getWeatherGovTokenFromWmoCodeWithWind = (code, windSpeedKmh, windGustsKmh) => {
|
const getWeatherGovTokenFromWmoCodeWithWind = (code, windSpeedKmh, windGustsKmh) => {
|
||||||
const baseToken = getWeatherGovTokenFromWmoCode(code);
|
const baseToken = getWeatherGovTokenFromWmoCode(code);
|
||||||
const windDesc = getWindDescriptor(windSpeedKmh, windGustsKmh);
|
const windDesc = getWindDescriptor(windSpeedKmh, windGustsKmh);
|
||||||
|
const windCapableTokens = new Set(['skc', 'few', 'sct', 'bkn', 'ovc']);
|
||||||
|
|
||||||
// Only use wind icon for non-precipitation conditions
|
if (windDesc && windCapableTokens.has(baseToken)) {
|
||||||
// Precipitation codes: drizzle, rain, freezing rain, snow, sleet, thunderstorms
|
|
||||||
const precipitationCodes = [51, 53, 55, 56, 57, 61, 63, 65, 66, 67, 71, 73, 75, 77, 80, 81, 82, 85, 86, 95, 96, 99];
|
|
||||||
|
|
||||||
if (windDesc && !precipitationCodes.includes(Number(code))) {
|
|
||||||
return `wind_${baseToken}`;
|
return `wind_${baseToken}`;
|
||||||
}
|
}
|
||||||
return baseToken;
|
return baseToken;
|
||||||
|
|
|
||||||
2
server/styles/ws.min.css
vendored
2
server/styles/ws.min.css
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue