diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-06-19 15:46:03 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-06-19 15:46:03 +0700 |
| commit | 637c22f1886cecf7307ced88dc951134d466a3fa (patch) | |
| tree | 7f00f63e13b3f5e56f3da06da1f98010937cd3cc /src/core/components | |
| parent | e4b4f2c09ebd819acc204c2e58288fe9fc6294ea (diff) | |
checkout
Diffstat (limited to 'src/core/components')
| -rw-r--r-- | src/core/components/elements/Navbar/NavbarDesktop.jsx | 8 |
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() |
