From 0916f0cc29a28526250d8b75785335239824f930 Mon Sep 17 00:00:00 2001 From: NaNorNull <74334433+NaNorNull@users.noreply.github.com> Date: Fri, 27 Aug 2021 15:14:18 -0400 Subject: [PATCH] Fix for error when removing an item When removing an item via Remove Item button, it produces an error that product is not defined. i.e., () => removeItem() does not pass product. Changing the function and calls to not pass product seems to work fine. --- src/components/CartItem.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/CartItem.svelte b/src/components/CartItem.svelte index af5687e..670fbbf 100644 --- a/src/components/CartItem.svelte +++ b/src/components/CartItem.svelte @@ -24,12 +24,12 @@ } else { //Remove the item - removeItem(product); + removeItem(); } } } - function removeItem(product) { + function removeItem() { let removedItemCart = $cart.filter((cartItem) => { return cartItem.id != product.id; });