3.0.2.3
Improved day tab selection and icons Tweaked at a glance panel
This commit is contained in:
@@ -385,7 +385,9 @@ export function computeGlanceSummary(todayRows, profile, variant, skinType, cols
|
||||
const peakRow = (field) => todayRows.reduce((best, r) =>
|
||||
(r[field] != null && (best == null || r[field] > best[field])) ? r : best, null);
|
||||
|
||||
const maxRainProb = Math.max(0, ...todayRows.map(r => r.precipProb ?? 0));
|
||||
const peakRainRow = todayRows.reduce((best, r) =>
|
||||
(r.precipProb != null && (best == null || r.precipProb > best.precipProb)) ? r : best, null);
|
||||
const maxRainProb = peakRainRow ? (peakRainRow.precipProb ?? 0) : 0;
|
||||
|
||||
// Longest run of rows that satisfy a predicate.
|
||||
const longestWindow = (rows, cond) => {
|
||||
@@ -428,7 +430,9 @@ export function computeGlanceSummary(todayRows, profile, variant, skinType, cols
|
||||
const rainItem = {
|
||||
icon: '🌧',
|
||||
label: 'Rain risk',
|
||||
value: `${Math.round(maxRainProb)}%`,
|
||||
value: maxRainProb > 0 && peakRainRow?.iso
|
||||
? `${Math.round(maxRainProb)}% at ${hhmm(peakRainRow.iso)}`
|
||||
: `${Math.round(maxRainProb)}%`,
|
||||
alert: maxRainProb >= 60,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user