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 2705e32..fbd4e96 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 @@ -416,8 +416,8 @@ export class TouchPadMenuComponent implements OnInit, OnDestroy { const group2 = allBoxed.slice(group1.length, group1.length + groupSize); const group3 = allBoxed.slice(group1.length + group2.length); const combined: (number | string)[] = [...group1]; - if (group2.length) combined.push( ...group2); - if (group3.length) combined.push( ...group3); + if (group2.length) combined.push('-', ...group2); + if (group3.length) combined.push('-', ...group3); this.selectedNumbers = combined; this.selectionService.updatePartial({ numbers: [...this.selectedNumbers], @@ -1610,15 +1610,44 @@ try { } // Update canEnterRow to require value between 1 and 100 get canEnterRow(): boolean { - if (this.maxRowsReached) return false; - const currentRow = this.selectionService.getCurrentRow(); - return !!currentRow.label && - !!currentRow.numbers && - currentRow.numbers.length > 0 && - typeof currentRow.value === 'number' && - currentRow.value >= 1 && - currentRow.value <= 100 && - currentRow.total > 0; -} + if (this.maxRowsReached) { + console.log('[DEBUG] canEnterRow: maxRowsReached is true, disabling Enter'); + return false; + } + + // Special handling for WSP + if (this.selectedLabel === 'WSP') { + const isValidPadValue = this.padValue.trim().length > 0 && /^[0-9]+$/.test(this.padValue); + const hasNumbers = this.selectedNumbers.length > 0; + console.log('[DEBUG] canEnterRow (WSP):', { + isValidPadValue, + hasNumbers, + padValue: this.padValue, + selectedNumbers: this.selectedNumbers, + wspTicketStage: this.wspTicketStage + }); + return isValidPadValue && hasNumbers; + } + + // Default logic for non-WSP + const currentRow = this.selectionService.getCurrentRow(); + const result = !!currentRow.label && + !!currentRow.numbers && + currentRow.numbers.length > 0 && + typeof currentRow.value === 'number' && + currentRow.value >= 1 && + currentRow.value <= 100 && + currentRow.total > 0; + + console.log('[DEBUG] canEnterRow (non-WSP):', { + label: currentRow.label, + numbers: currentRow.numbers, + value: currentRow.value, + total: currentRow.total, + result + }); + return result; + } + }