Truncate grid display to 4 characters for VUCC awards
For VUCC awards, ensure the grid square is truncated to 4 characters both when counting unique entities AND when displaying. This fixes VUCC award details to show 'FN31' instead of 'FN31pr', making it clear that we're counting unique 4-character grid squares. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -283,7 +283,12 @@ export async function getAwardEntityBreakdown(userId, awardId) {
|
|||||||
// Use displayField from award rules, or fallback to entity/type
|
// Use displayField from award rules, or fallback to entity/type
|
||||||
let displayName = String(entity);
|
let displayName = String(entity);
|
||||||
if (rules.displayField) {
|
if (rules.displayField) {
|
||||||
displayName = String(qso[rules.displayField] || entity);
|
let rawValue = qso[rules.displayField];
|
||||||
|
// For grid-based awards, truncate to first 4 characters
|
||||||
|
if (rules.displayField === 'grid' && rawValue && rawValue.length > 4) {
|
||||||
|
rawValue = rawValue.substring(0, 4);
|
||||||
|
}
|
||||||
|
displayName = String(rawValue || entity);
|
||||||
} else {
|
} else {
|
||||||
// Fallback: try entity, state, grid, callsign in order
|
// Fallback: try entity, state, grid, callsign in order
|
||||||
displayName = qso.entity || qso.state || qso.grid || qso.callsign || String(entity);
|
displayName = qso.entity || qso.state || qso.grid || qso.callsign || String(entity);
|
||||||
|
|||||||
Reference in New Issue
Block a user