summaryrefslogtreecommitdiff
path: root/src/core/components/elements/Navbar/NavbarDesktop.jsx
diff options
context:
space:
mode:
authortrisusilo <tri.susilo@altama.co.id>2023-07-24 03:32:03 +0000
committertrisusilo <tri.susilo@altama.co.id>2023-07-24 03:32:03 +0000
commit4fcb73a336a6025a0ead194b317543efcd4f0e4b (patch)
tree20ea651ea2c02be2bae2c2915ca5ab7ff2f95538 /src/core/components/elements/Navbar/NavbarDesktop.jsx
parentd61b3ca0213395099e4cea9ace8172d4e622fb52 (diff)
parent984f1b13b408ee9652072392d6312d609b353315 (diff)
Merged in Feature/promotion_programvaoucher (pull request #15)
Feature/promotion programvaoucher
Diffstat (limited to 'src/core/components/elements/Navbar/NavbarDesktop.jsx')
-rw-r--r--src/core/components/elements/Navbar/NavbarDesktop.jsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx
index 26edd5a4..733f5422 100644
--- a/src/core/components/elements/Navbar/NavbarDesktop.jsx
+++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx
@@ -13,7 +13,7 @@ import Category from '@/lib/category/components/Category'
import { useEffect, useState } from 'react'
import useAuth from '@/core/hooks/useAuth'
import NavbarUserDropdown from './NavbarUserDropdown'
-import { getCart } from '@/core/utils/cart'
+import { getCountCart } from '@/core/utils/cart'
import TopBanner from './TopBanner'
import whatsappUrl from '@/core/utils/whatsappUrl'
@@ -27,7 +27,11 @@ const NavbarDesktop = () => {
useEffect(() => {
const handleCartChange = () => {
- setCartCount(Object.keys(getCart()).length)
+ const cart = async () => {
+ const listCart = await getCountCart()
+ setCartCount(listCart)
+ }
+ cart()
}
handleCartChange()