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 = '';
|
||||
if (['FRP', 'QNP'].includes(row.label)) {
|
||||
const actualNumbers = displayNumbers.filter(n => n !== '#').join(',');
|
||||
if (row.numbers.includes('#') || row.isBoxed) {
|
||||
numbersStr = `${actualNumbers} - ${actualNumbers}`;
|
||||
} else {
|
||||
numbersStr = actualNumbers;
|
||||
}
|
||||
} else {
|
||||
numbersStr = displayNumbers.filter(n => n !== '#').join(',');
|
||||
}
|
||||
let numbersStr = '';
|
||||
if (['FRP', 'QNP', 'TNP'].includes(row.label)) {
|
||||
if (row.isBoxed) {
|
||||
// Keep only numeric tokens; stringify when comparing to '#' to avoid number vs string compare.
|
||||
const actualNumbers = displayNumbers
|
||||
.filter((n): n is number => typeof n === 'number' && String(n) !== '#')
|
||||
.map(n => String(n).padStart(2, '0'))
|
||||
.join(',');
|
||||
numbersStr = `<<${actualNumbers}>>`;
|
||||
} 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 numbers = numbersStr.padEnd(15);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user