diff --git a/btc-UI/src/app/components/touch-pad-menu/touch-pad-menu.component.html b/btc-UI/src/app/components/touch-pad-menu/touch-pad-menu.component.html index d916233..f8e6d58 100755 --- a/btc-UI/src/app/components/touch-pad-menu/touch-pad-menu.component.html +++ b/btc-UI/src/app/components/touch-pad-menu/touch-pad-menu.component.html @@ -104,10 +104,22 @@
- +
- +
diff --git a/btc-UI/src/app/components/touch-pad-menu/touch-pad-menu.component.ts b/btc-UI/src/app/components/touch-pad-menu/touch-pad-menu.component.ts index cea60ca..46234b5 100755 --- a/btc-UI/src/app/components/touch-pad-menu/touch-pad-menu.component.ts +++ b/btc-UI/src/app/components/touch-pad-menu/touch-pad-menu.component.ts @@ -299,9 +299,31 @@ export class TouchPadMenuComponent implements OnInit, OnDestroy { } onPadEnter() { - if (this.canPrint) { - this.print(); - } + // Only allows entry if less than 5 rows are filled + if (this.maxRowsReached) return; + + const value = parseFloat(this.padValue) || 0; + if (!this.selectedLabel || !this.selectedNumbers.length || value === 0) return; // Basic validation + + // Finalize current row selection + this.selectionService.finalizeCurrentRow(); + + // Clear current row selection, but do NOT clear the existing rows, + // so user can keep filling rows up to 5 + this.selectedLabel = null; + this.selectedNumbers = []; + this.padValue = ''; + this.canPrint = false; + this.isBoxed = false; + + // Reset all group stages + this.tanGroupStage = 0; + this.tanGroups = [[], [], []]; + this.isFirstGroupComplete = false; + this.firstGroup = []; + this.secondGroup = []; + this.multiLegStage = 0; + this.multiLegGroups = [[], [], [], [], []]; } onShashEnter() { @@ -369,13 +391,19 @@ export class TouchPadMenuComponent implements OnInit, OnDestroy { } print() { + // Don't print if no rows + if (this.currentSelections.length === 0) return; + const selectionsTotal = this.currentSelections.reduce((sum, sel) => sum + sel.total, 0); if (selectionsTotal + this.currentTotal > 5000) { this.showLimitPopup = true; return; } + // Submit all rows this.selectionService.finalizeCurrentRow(); - this.resetSelections(); + + // Clear everything after print + this.erase(); } erase() {