Compare commits

...

4 Commits

Author SHA1 Message Date
ItzCrazyKns
7dc5d088f7 Merge branch 'master' of https://github.com/ItzCrazyKns/Vane 2026-04-11 19:51:16 +05:30
ItzCrazyKns
adc68fc050 feat(docker): update slim image 2026-04-11 19:51:12 +05:30
Kushagra Srivastava
97c0ad59f4 Merge pull request #1097 from lawrence3699/fix/weather-switch-fallthrough
fix: add missing break statements in weather code switch
2026-04-10 19:23:02 +05:30
lawrence3699
e0aac65e64 fix: add missing break statements in weather code switch
WMO weather codes 1, 2, 45, 51, 53, 56, 61, 63, 66, 71, 73, 80, 81,
85, 86, and 96 were missing break statements, causing fall-through
that overwrote each condition with the last label in its group. For
example, code 1 (Mainly Clear) fell through to code 3, so the widget
always displayed 'Cloudy'. Also adds the shared group icon to each
early case so the widget renders an icon for every code.
2026-04-10 00:33:06 +10:00
2 changed files with 35 additions and 0 deletions

View File

@@ -30,6 +30,9 @@ COPY drizzle ./drizzle
RUN mkdir /home/vane/uploads RUN mkdir /home/vane/uploads
RUN yarn add playwright
RUN yarn playwright install --with-deps --only-shell chromium
EXPOSE 3000 EXPOSE 3000
CMD ["node", "server.js"] CMD ["node", "server.js"]

View File

@@ -62,57 +62,79 @@ export const POST = async (req: Request) => {
break; break;
case 1: case 1:
weather.icon = `cloudy-1-${dayOrNight}`;
weather.condition = 'Mainly Clear'; weather.condition = 'Mainly Clear';
break;
case 2: case 2:
weather.icon = `cloudy-1-${dayOrNight}`;
weather.condition = 'Partly Cloudy'; weather.condition = 'Partly Cloudy';
break;
case 3: case 3:
weather.icon = `cloudy-1-${dayOrNight}`; weather.icon = `cloudy-1-${dayOrNight}`;
weather.condition = 'Cloudy'; weather.condition = 'Cloudy';
break; break;
case 45: case 45:
weather.icon = `fog-${dayOrNight}`;
weather.condition = 'Fog'; weather.condition = 'Fog';
break;
case 48: case 48:
weather.icon = `fog-${dayOrNight}`; weather.icon = `fog-${dayOrNight}`;
weather.condition = 'Fog'; weather.condition = 'Fog';
break; break;
case 51: case 51:
weather.icon = `rainy-1-${dayOrNight}`;
weather.condition = 'Light Drizzle'; weather.condition = 'Light Drizzle';
break;
case 53: case 53:
weather.icon = `rainy-1-${dayOrNight}`;
weather.condition = 'Moderate Drizzle'; weather.condition = 'Moderate Drizzle';
break;
case 55: case 55:
weather.icon = `rainy-1-${dayOrNight}`; weather.icon = `rainy-1-${dayOrNight}`;
weather.condition = 'Dense Drizzle'; weather.condition = 'Dense Drizzle';
break; break;
case 56: case 56:
weather.icon = `frost-${dayOrNight}`;
weather.condition = 'Light Freezing Drizzle'; weather.condition = 'Light Freezing Drizzle';
break;
case 57: case 57:
weather.icon = `frost-${dayOrNight}`; weather.icon = `frost-${dayOrNight}`;
weather.condition = 'Dense Freezing Drizzle'; weather.condition = 'Dense Freezing Drizzle';
break; break;
case 61: case 61:
weather.icon = `rainy-2-${dayOrNight}`;
weather.condition = 'Slight Rain'; weather.condition = 'Slight Rain';
break;
case 63: case 63:
weather.icon = `rainy-2-${dayOrNight}`;
weather.condition = 'Moderate Rain'; weather.condition = 'Moderate Rain';
break;
case 65: case 65:
weather.condition = 'Heavy Rain'; weather.condition = 'Heavy Rain';
weather.icon = `rainy-2-${dayOrNight}`; weather.icon = `rainy-2-${dayOrNight}`;
break; break;
case 66: case 66:
weather.icon = 'rain-and-sleet-mix';
weather.condition = 'Light Freezing Rain'; weather.condition = 'Light Freezing Rain';
break;
case 67: case 67:
weather.condition = 'Heavy Freezing Rain'; weather.condition = 'Heavy Freezing Rain';
weather.icon = 'rain-and-sleet-mix'; weather.icon = 'rain-and-sleet-mix';
break; break;
case 71: case 71:
weather.icon = `snowy-2-${dayOrNight}`;
weather.condition = 'Slight Snow Fall'; weather.condition = 'Slight Snow Fall';
break;
case 73: case 73:
weather.icon = `snowy-2-${dayOrNight}`;
weather.condition = 'Moderate Snow Fall'; weather.condition = 'Moderate Snow Fall';
break;
case 75: case 75:
weather.condition = 'Heavy Snow Fall'; weather.condition = 'Heavy Snow Fall';
weather.icon = `snowy-2-${dayOrNight}`; weather.icon = `snowy-2-${dayOrNight}`;
@@ -124,18 +146,26 @@ export const POST = async (req: Request) => {
break; break;
case 80: case 80:
weather.icon = `rainy-3-${dayOrNight}`;
weather.condition = 'Slight Rain Showers'; weather.condition = 'Slight Rain Showers';
break;
case 81: case 81:
weather.icon = `rainy-3-${dayOrNight}`;
weather.condition = 'Moderate Rain Showers'; weather.condition = 'Moderate Rain Showers';
break;
case 82: case 82:
weather.condition = 'Heavy Rain Showers'; weather.condition = 'Heavy Rain Showers';
weather.icon = `rainy-3-${dayOrNight}`; weather.icon = `rainy-3-${dayOrNight}`;
break; break;
case 85: case 85:
weather.icon = `snowy-3-${dayOrNight}`;
weather.condition = 'Slight Snow Showers'; weather.condition = 'Slight Snow Showers';
break;
case 86: case 86:
weather.icon = `snowy-3-${dayOrNight}`;
weather.condition = 'Moderate Snow Showers'; weather.condition = 'Moderate Snow Showers';
break;
case 87: case 87:
weather.condition = 'Heavy Snow Showers'; weather.condition = 'Heavy Snow Showers';
weather.icon = `snowy-3-${dayOrNight}`; weather.icon = `snowy-3-${dayOrNight}`;
@@ -147,7 +177,9 @@ export const POST = async (req: Request) => {
break; break;
case 96: case 96:
weather.icon = 'severe-thunderstorm';
weather.condition = 'Thunderstorm with Slight Hail'; weather.condition = 'Thunderstorm with Slight Hail';
break;
case 99: case 99:
weather.condition = 'Thunderstorm with Heavy Hail'; weather.condition = 'Thunderstorm with Heavy Hail';
weather.icon = 'severe-thunderstorm'; weather.icon = 'severe-thunderstorm';