From 441f1efb230f14dd57bbe2866471458de6265e90 Mon Sep 17 00:00:00 2001 From: Jerald-Golden-B Date: Tue, 26 Aug 2025 16:49:16 +0530 Subject: [PATCH] side bar left bug fix --- app/src/components/layout/sidebarLeft/Assets.tsx | 10 +++++++--- app/src/store/builder/store.ts | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/components/layout/sidebarLeft/Assets.tsx b/app/src/components/layout/sidebarLeft/Assets.tsx index 4e946d3..8216310 100644 --- a/app/src/components/layout/sidebarLeft/Assets.tsx +++ b/app/src/components/layout/sidebarLeft/Assets.tsx @@ -120,7 +120,12 @@ const Assets: React.FC = () => { echo.error("failed to fetch assets"); setisLoading(false); } + + if (asset === "Decals") { + fetchCategoryDecals("Safety"); + } }; + const fetchCategoryDecals = async (asset: any) => { setisLoading(true); // setSelectedCategory(asset); @@ -226,9 +231,8 @@ const Assets: React.FC = () => { {activeSubcategories.map((cat, index) => (
{ fetchCategoryDecals(cat.name); setSelectedSubCategory(cat.name); diff --git a/app/src/store/builder/store.ts b/app/src/store/builder/store.ts index 893bd65..2f72b98 100644 --- a/app/src/store/builder/store.ts +++ b/app/src/store/builder/store.ts @@ -664,6 +664,6 @@ interface DecalStore { // Create the Zustand store with types export const useDecalStore = create((set) => ({ - selectedSubCategory: null, + selectedSubCategory: 'Safety', setSelectedSubCategory: (subCategory: string | null) => set({ selectedSubCategory: subCategory }), }));