Skip to content

Commit 8671332

Browse files
authored
fix: cart crash on backorders (#105)
1 parent 9a87693 commit 8671332

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/modules/cart/components/item/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,15 @@ const Item = ({ item, region }: ItemProps) => {
3535
}
3636
className="max-h-[35px] w-[75px]"
3737
>
38-
{Array.from([...Array(item.variant.inventory_quantity)].keys())
38+
{Array.from(
39+
[
40+
...Array(
41+
item.variant.inventory_quantity > 0
42+
? item.variant.inventory_quantity
43+
: 10
44+
),
45+
].keys()
46+
)
3947
.slice(0, 10)
4048
.map((i) => {
4149
const value = i + 1

0 commit comments

Comments
 (0)