fix : FOR,QUI,TAN (F - directly addes) working

This commit is contained in:
karthik 2025-07-29 23:39:46 +05:30
parent 37e066d0fb
commit 8c557be5b8

View File

@ -462,6 +462,53 @@ export class TouchPadMenuComponent implements OnInit {
default: return 3; default: return 3;
} }
} }
private handleFieldForSpecialLabels() {
if (!this.selectedLabel) return;
if (this.selectedLabel === 'FOR' || this.selectedLabel === 'QUI') {
if (!this.isFirstGroupComplete) {
this.firstGroup = ['F'];
this.selectedNumbers = ['F'];
this.selectionService.updatePartial({
label: this.selectedLabel,
numbers: [...this.selectedNumbers],
isBoxed: false,
value: 1
});
} else {
this.secondGroup = ['F'];
this.selectedNumbers = [...this.firstGroup, '-', 'F'];
this.selectionService.updatePartial({
label: this.selectedLabel,
numbers: [...this.selectedNumbers],
isBoxed: false,
value: 1
});
}
} else if (this.selectedLabel === 'TAN') {
if (this.isBoxed) {
this.selectedNumbers = ['F'];
this.selectionService.updatePartial({
label: this.selectedLabel,
numbers: ['F'],
isBoxed: true,
value: 1
});
} else {
this.tanGroups[this.tanGroupStage] = ['F'];
const combined: (number | string)[] = [...this.tanGroups[0]];
if (this.tanGroupStage > 0) combined.push('-', ...this.tanGroups[1]);
if (this.tanGroupStage > 1) combined.push('-', ...this.tanGroups[2]);
this.selectedNumbers = combined;
this.selectionService.updatePartial({
label: this.selectedLabel,
numbers: [...this.selectedNumbers],
isBoxed: false,
value: 1
});
}
}
}
// Calculator and Field Modal methods (unchanged) // Calculator and Field Modal methods (unchanged)
openCalculator() { this.calculatorOpen = true; this.calcDisplay = ''; } openCalculator() { this.calculatorOpen = true; this.calcDisplay = ''; }
@ -501,11 +548,14 @@ export class TouchPadMenuComponent implements OnInit {
} }
openFieldModal() { openFieldModal() {
if (['FOR', 'QUI', 'TAN'].includes(this.selectedLabel || '')) {
this.handleFieldForSpecialLabels();
} else {
this.fieldModalOpen = true; this.fieldModalOpen = true;
this.fieldInput = ''; this.fieldInput = '';
this.fieldFEntered = false; this.fieldFEntered = false;
} }
}
closeFieldModal() { closeFieldModal() {
this.fieldModalOpen = false; this.fieldModalOpen = false;
} }