side bar left bug fix
This commit is contained in:
@@ -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) => (
|
||||
<div
|
||||
key={index}
|
||||
className={`catogory-asset-filter-wrapper ${
|
||||
selectedSubCategory === cat.name ? "active" : ""
|
||||
}`}
|
||||
className={`catogory-asset-filter-wrapper ${selectedSubCategory === cat.name ? "active" : ""
|
||||
}`}
|
||||
onClick={() => {
|
||||
fetchCategoryDecals(cat.name);
|
||||
setSelectedSubCategory(cat.name);
|
||||
|
||||
@@ -664,6 +664,6 @@ interface DecalStore {
|
||||
|
||||
// Create the Zustand store with types
|
||||
export const useDecalStore = create<DecalStore>((set) => ({
|
||||
selectedSubCategory: null,
|
||||
selectedSubCategory: 'Safety',
|
||||
setSelectedSubCategory: (subCategory: string | null) => set({ selectedSubCategory: subCategory }),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user