fix : box is fixed for frp,tnp,qnp
This commit is contained in:
parent
4ffb953f3f
commit
41c6adc1d4
@ -1149,17 +1149,34 @@ export class TouchPadMenuComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let numbersStr = '';
|
let numbersStr = '';
|
||||||
if (['FRP', 'QNP'].includes(row.label)) {
|
if (['FRP', 'QNP', 'TNP'].includes(row.label)) {
|
||||||
const actualNumbers = displayNumbers.filter(n => n !== '#').join(',');
|
if (row.isBoxed) {
|
||||||
if (row.numbers.includes('#') || row.isBoxed) {
|
// Keep only numeric tokens; stringify when comparing to '#' to avoid number vs string compare.
|
||||||
numbersStr = `${actualNumbers} - ${actualNumbers}`;
|
const actualNumbers = displayNumbers
|
||||||
} else {
|
.filter((n): n is number => typeof n === 'number' && String(n) !== '#')
|
||||||
numbersStr = actualNumbers;
|
.map(n => String(n).padStart(2, '0'))
|
||||||
}
|
.join(',');
|
||||||
} else {
|
numbersStr = `<<${actualNumbers}>>`;
|
||||||
numbersStr = displayNumbers.filter(n => n !== '#').join(',');
|
} else if (['FRP', 'QNP'].includes(row.label)) {
|
||||||
}
|
// Convert every token to string for safe comparisons and joining.
|
||||||
|
const actualNumbers = displayNumbers.map(n => String(n)).filter(s => s !== '#').join(',');
|
||||||
|
// Safe check for '#' presence in row.numbers by stringifying elements
|
||||||
|
const rowHasHash = Array.isArray(row.numbers) && row.numbers.some(x => String(x) === '#');
|
||||||
|
if (rowHasHash || row.isBoxed) {
|
||||||
|
numbersStr = `${actualNumbers} - ${actualNumbers}`;
|
||||||
|
} else {
|
||||||
|
numbersStr = actualNumbers;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// case: TNP but not boxed (falls through here). Use string comparisons consistently.
|
||||||
|
numbersStr = displayNumbers.map(n => String(n)).filter(s => s !== '#').join(',');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Default: non-FRP/QNP/TNP labels
|
||||||
|
numbersStr = displayNumbers.map(n => String(n)).filter(s => s !== '#').join(',');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const label = displayLabel.padEnd(10);
|
const label = displayLabel.padEnd(10);
|
||||||
const numbers = numbersStr.padEnd(15);
|
const numbers = numbersStr.padEnd(15);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user