Client fixes
This commit is contained in:
@@ -144,7 +144,7 @@ export async function getCoords() {
|
||||
`;
|
||||
const rows = await query(flux);
|
||||
if(rows.length && rows[0].latitude && rows[0].longitude) {
|
||||
return {lat: rows[0].latitude, lon: rows[0].longitude, alt: rows[0].altitude || c.ALTITUDE};
|
||||
return {latitude: rows[0].latitude, longitude: rows[0].longitude, altitude: rows[0].altitude || c.ALTITUDE};
|
||||
}
|
||||
return {latitude: c.LATITUDE, longitude: c.LONGITUDE, altitude: c.ALTITUDE};
|
||||
}
|
||||
|
||||
@@ -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