fix : enter and print are properly enabling and disabling
This commit is contained in:
parent
7738818b3e
commit
ab9377f736
@ -90,7 +90,7 @@
|
||||
</div>
|
||||
</ng-container>
|
||||
<div class="col-6">
|
||||
<button class="btn btn-secondary w-100 number-button" [disabled]="!numericPadEnabled || maxRowsReached" (click)="onPadEnter()">Enter</button>
|
||||
<button class="btn btn-secondary w-100 number-button" [disabled]="!canEnterRow" (click)="onPadEnter()">Enter</button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<button class="btn btn-secondary w-100 number-button" [disabled]="!canPrintTicket" (click)="printTicket()">Print</button>
|
||||
|
||||
@ -1608,5 +1608,17 @@ try {
|
||||
get dedupedEnabledHorseNumbers(): number[] {
|
||||
return _.uniq(this.enabledHorseNumbers);
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user