fix: correct column sum calculation for satellite QSOs
The SAT column sum was always showing 0 because it was filtering by e.band === 'SAT', but entities still have their original band in the data. Now it correctly identifies satellite QSOs by checking if any QSOs have satName. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -299,22 +299,46 @@
|
||||
// Sum points for confirmed QSOs in this column
|
||||
if (isMixedMode) {
|
||||
const sum = entities
|
||||
.filter(e => e.band === band && e.confirmed)
|
||||
.filter(e => {
|
||||
// For SAT column, check if entity has satellite QSOs
|
||||
if (band === 'SAT') {
|
||||
return e.qsos && e.qsos.some(qso => qso.satName) && e.confirmed;
|
||||
}
|
||||
return e.band === band && e.confirmed;
|
||||
})
|
||||
.reduce((total, e) => total + (e.points || 0), 0);
|
||||
sums.set(key, sum);
|
||||
} else {
|
||||
const sum = entities
|
||||
.filter(e => e.band === band && e.mode === mode && e.confirmed)
|
||||
.filter(e => {
|
||||
// For SAT column, check if entity has satellite QSOs
|
||||
if (band === 'SAT') {
|
||||
return e.qsos && e.qsos.some(qso => qso.satName) && e.mode === mode && e.confirmed;
|
||||
}
|
||||
return e.band === band && e.mode === mode && e.confirmed;
|
||||
})
|
||||
.reduce((total, e) => total + (e.points || 0), 0);
|
||||
sums.set(key, sum);
|
||||
}
|
||||
} else {
|
||||
// Count confirmed QSOs in this column
|
||||
if (isMixedMode) {
|
||||
const count = entities.filter(e => e.band === band && e.confirmed).length;
|
||||
const count = entities.filter(e => {
|
||||
// For SAT column, check if entity has satellite QSOs
|
||||
if (band === 'SAT') {
|
||||
return e.qsos && e.qsos.some(qso => qso.satName) && e.confirmed;
|
||||
}
|
||||
return e.band === band && e.confirmed;
|
||||
}).length;
|
||||
sums.set(key, count);
|
||||
} else {
|
||||
const count = entities.filter(e => e.band === band && e.mode === mode && e.confirmed).length;
|
||||
const count = entities.filter(e => {
|
||||
// For SAT column, check if entity has satellite QSOs
|
||||
if (band === 'SAT') {
|
||||
return e.qsos && e.qsos.some(qso => qso.satName) && e.mode === mode && e.confirmed;
|
||||
}
|
||||
return e.band === band && e.mode === mode && e.confirmed;
|
||||
}).length;
|
||||
sums.set(key, count);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user