Fix some errors after cart refactor

This commit is contained in:
Michał Gdula 2024-05-03 19:21:28 +01:00
parent 7066cc492b
commit 7f7fa3b3ab
2 changed files with 10 additions and 1 deletions

View file

@ -42,6 +42,13 @@ function createCartStore() {
)
});
}
cart.update((cart: Record<string, CartItem>) => {
if (cart[uuid].amount <= 0) {
delete cart[uuid];
}
return cart;
})
}
function getEntries(): [string, CartItem][] {