mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-17 13:04:21 +01:00
Fix flaky CanUsePOSCart
This commit is contained in:
@@ -96,10 +96,10 @@
|
||||
}
|
||||
@if (item.Inventory.HasValue)
|
||||
{
|
||||
<span class="badge text-bg-warning inventory" v-text="inventoryText(@index)">
|
||||
<span class="badge text-bg-warning inventory">
|
||||
@if (item.Inventory > 0)
|
||||
{
|
||||
<span>@ViewLocalizer["{0} left", item.Inventory.ToString()]</span>
|
||||
<span>@StringLocalizer["{0} left", item.Inventory.ToString()]</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
}
|
||||
@if (item.Inventory.HasValue)
|
||||
{
|
||||
<span class="badge text-bg-warning inventory" v-text="inventoryText(@index)">
|
||||
<span class="badge text-bg-warning inventory">
|
||||
@if (item.Inventory > 0)
|
||||
{
|
||||
<span>@ViewLocalizer["{0} left", item.Inventory.ToString()]</span>
|
||||
|
||||
@@ -291,14 +291,6 @@ const posCommon = {
|
||||
|
||||
return item.inventory == null || item.inventory > (itemInCart ? itemInCart.count : 0)
|
||||
},
|
||||
inventoryText(index) {
|
||||
const item = this.items[index]
|
||||
if (item.inventory == null) return null
|
||||
|
||||
const itemInCart = this.cart.find(lineItem => lineItem.id === item.id)
|
||||
const left = item.inventory - (itemInCart ? itemInCart.count : 0)
|
||||
return left > 0 ? `${item.inventory} left` : 'Sold out'
|
||||
},
|
||||
addToCart(index, count) {
|
||||
if (!this.inStock(index)) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user