summaryrefslogtreecommitdiff
path: root/src/lib/cart/components/Cart.jsx
diff options
context:
space:
mode:
authortrisusilo <tri.susilo@altama.co.id>2023-09-22 03:25:33 +0000
committertrisusilo <tri.susilo@altama.co.id>2023-09-22 03:25:33 +0000
commit8b12b43c0c3f9dd2d2743c83c23ed2a3f30fdae0 (patch)
tree6ce4958f4000e3db72ceddebe7ffb468eefe395b /src/lib/cart/components/Cart.jsx
parent74b4e3a9b86f1d3b102ad3f907237f7da1b05009 (diff)
parentbda91439b6ef4605a579bde8bef603b551aab3dd (diff)
Merged in Feature/popup_cart (pull request #73)
Feature/popup cart
Diffstat (limited to 'src/lib/cart/components/Cart.jsx')
-rw-r--r--src/lib/cart/components/Cart.jsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx
index efbcf76b..b5976a1b 100644
--- a/src/lib/cart/components/Cart.jsx
+++ b/src/lib/cart/components/Cart.jsx
@@ -22,6 +22,7 @@ import LogoSpinner from '@/core/components/elements/Spinner/LogoSpinner'
import { getPromotionProgram } from '@/lib/promotinProgram/api/homepageApi'
import PromotionType from '@/lib/promotinProgram/components/PromotionType'
import { gtagBeginCheckout } from '@/core/utils/googleTag'
+import { useProductCartContext } from '@/contexts/ProductCartContext'
const Cart = () => {
const router = useRouter()
@@ -31,6 +32,8 @@ const Cart = () => {
const [cart, setCart] = useState(null)
+ const {setRefreshCart} = useProductCartContext()
+
useEffect(() => {
if (!auth) return
}, [auth])
@@ -196,6 +199,7 @@ const Cart = () => {
deleteItemCart({ productId })
setDeleteConfirmation(null)
setProducts([...productsToUpdate])
+ setRefreshCart(true)
toast.success('Berhasil menghapus barang dari keranjang')
}