From e8e7275a25939bfaeacaf2a9cbf508b514647057 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 8 Oct 2024 10:31:13 +0700
Subject: <iman> update category management to storage on local

---
 src/lib/home/components/CategoryDynamic.jsx | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'src/lib/home/components/CategoryDynamic.jsx')

diff --git a/src/lib/home/components/CategoryDynamic.jsx b/src/lib/home/components/CategoryDynamic.jsx
index 412c6153..596b18f2 100644
--- a/src/lib/home/components/CategoryDynamic.jsx
+++ b/src/lib/home/components/CategoryDynamic.jsx
@@ -41,7 +41,7 @@ const CategoryDynamic = () => {
   const [isLoading, setIsLoading] = useState(false);
 
   const loadBrand = useCallback(async () => {
-    const cachedData = getFromLocalStorage('categoryManagementData');
+    const cachedData = getFromLocalStorage('homepage_categoryDynamic'); // nama key namaPage_namaKomopnen
 
     // apakah data sudah kadaluarsa
     const dataExpired = cachedData ? isExpired(cachedData.expiry) : true;
@@ -56,7 +56,7 @@ const CategoryDynamic = () => {
       if (cachedData && cachedData.version === latestVersion) {
         // Jika versinya sama, reset expiry
         saveToLocalStorage(
-          'categoryManagementData',
+          'homepage_categoryDynamic',
           cachedData.value,
           latestVersion,
           24
@@ -69,7 +69,12 @@ const CategoryDynamic = () => {
         setIsLoading(false);
 
         // Simpan data baru
-        saveToLocalStorage('categoryManagementData', items, latestVersion, 24);
+        saveToLocalStorage(
+          'homepage_categoryDynamic',
+          items,
+          latestVersion,
+          24
+        );
         setCategoryManagement(items);
       }
     }
-- 
cgit v1.2.3

