Client fixes
This commit is contained in:
@@ -31,12 +31,6 @@ export const WMO = {
|
||||
99: { label: 'Thunderstorm w/ Hail', icon: '11d' },
|
||||
}
|
||||
|
||||
export function weatherFromCode(code, isDay = true) {
|
||||
const w = WMO[code] ?? { label: 'Unknown', icon: '01d' }
|
||||
const icon = isDay ? w.icon : w.icon.replace('d', 'n')
|
||||
return { weather_code: code, weather_label: w.label, weather_icon: `/icons/${icon}.png` }
|
||||
}
|
||||
|
||||
export async function downloadIcons() {
|
||||
if (!existsSync(DIR)) mkdirSync(DIR, { recursive: true })
|
||||
const icons = new Set(Object.values(WMO).map(w => [w.icon, w.icon.replace('d','n')]).flat())
|
||||
|
||||
Reference in New Issue
Block a user