feat(cart): implement optimistic quantity updates with rollback on error
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
</header>
|
||||
|
||||
<div class="d-grid gap-2 flex-grow-1 overflow-y-auto cart-items-container">
|
||||
@for (item of items(); track item.product + item.discountedPrice + resetKey(); let idx = $index) {
|
||||
@for (item of items(); track item.productVariantId || item.product + item.discountedPrice; let idx = $index) {
|
||||
<app-cart-item
|
||||
[imageUrl]="item.imageUrl"
|
||||
[product]="item.product"
|
||||
@@ -18,7 +18,7 @@
|
||||
[discountedPrice]="item.discountedPrice"
|
||||
[discountPercentage]="item.discountPercentage"
|
||||
[attributes]="item.attributes"
|
||||
[quantity]="item.quantity"
|
||||
[quantity]="getItemQuantity(item)"
|
||||
(quantityChange)="onItemQuantityChange(idx, $event)"
|
||||
(remove)="onItemRemove(idx)"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user