summaryrefslogtreecommitdiff
path: root/src/core/components/elements/Navbar/NavbarDesktop.jsx
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-07-24 15:33:17 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-07-24 15:33:17 +0700
commit2de322571bad7490baaf439fa2bb12124c646bb5 (patch)
treed7c4151eb2bf83b85cd0532d45dedd02aa06694e /src/core/components/elements/Navbar/NavbarDesktop.jsx
parent8b8ab7680be37e84d0dc6cc1683fe4996f7cc8c1 (diff)
parentd4f3cce1b07c5d4f75892ffc49c8dbbbbb58922f (diff)
Merge branch 'master' into CR/widget_WA
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 eb1bc48c..ea4b03ae 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'
import { useRouter } from 'next/router'
@@ -36,7 +36,11 @@ const NavbarDesktop = () => {
useEffect(() => {
const handleCartChange = () => {
- setCartCount(Object.keys(getCart()).length)
+ const cart = async () => {
+ const listCart = await getCountCart()
+ setCartCount(listCart)
+ }
+ cart()
}
handleCartChange()