fix(checkout): disable cart access
This commit is contained in:
@@ -5,7 +5,7 @@ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/co
|
||||
imports: [],
|
||||
templateUrl: './cart-icon.component.html',
|
||||
styleUrl: './cart-icon.component.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class CartIconComponent {
|
||||
readonly quantity = input<number | null | undefined>(undefined);
|
||||
@@ -13,6 +13,10 @@ export class CartIconComponent {
|
||||
readonly ariaLabel = input<string>('Carrito de compras');
|
||||
|
||||
protected readonly hasQuantity = computed(() => {
|
||||
if (this.disabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const q = this.quantity();
|
||||
return q !== null && q !== undefined && q > 0;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user