From e189ea99d3d21273fce7642b4562bed5ac28783d Mon Sep 17 00:00:00 2001 From: Vishnu Date: Thu, 8 May 2025 15:29:19 +0530 Subject: [PATCH] Refactor asset loading error handling in Assets component; enable loading state reset on error; update Project component to render LoadingPage and Scene conditionally; add AssetDetailsCard component. --- app/src/components/layout/sidebarLeft/Assets.tsx | 4 +++- app/src/components/ui/simulation/AssetDetailsCard.tsx | 11 +++++++++++ app/src/pages/Project.tsx | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 app/src/components/ui/simulation/AssetDetailsCard.tsx diff --git a/app/src/components/layout/sidebarLeft/Assets.tsx b/app/src/components/layout/sidebarLeft/Assets.tsx index c5667f2..b863500 100644 --- a/app/src/components/layout/sidebarLeft/Assets.tsx +++ b/app/src/components/layout/sidebarLeft/Assets.tsx @@ -154,12 +154,14 @@ const Assets: React.FC = () => { setCategoryAssets(res); setFiltereredAssets(res); setisLoading(false); // End loading + // eslint-disable-next-line } catch (error) { - setisLoading(false); echo.error("failed to fetch assets"); + setisLoading(false); } } }; + return (
diff --git a/app/src/components/ui/simulation/AssetDetailsCard.tsx b/app/src/components/ui/simulation/AssetDetailsCard.tsx new file mode 100644 index 0000000..deb5375 --- /dev/null +++ b/app/src/components/ui/simulation/AssetDetailsCard.tsx @@ -0,0 +1,11 @@ +import React from 'react' + +const AssetDetailsCard:React.FC = () => { + return ( +
+ +
+ ) +} + +export default AssetDetailsCard \ No newline at end of file diff --git a/app/src/pages/Project.tsx b/app/src/pages/Project.tsx index 373629b..aa203c3 100644 --- a/app/src/pages/Project.tsx +++ b/app/src/pages/Project.tsx @@ -86,7 +86,7 @@ const Project: React.FC = () => { {!selectedUser && ( <> - {/* {loadingProgress > 0 && } */} + {loadingProgress > 0 && } {!isPlaying && ( <> {toggleThreeD && } @@ -122,7 +122,7 @@ const Project: React.FC = () => { } onDragOver={(event) => event.preventDefault()} > - {/* */} +
{selectedUser && } {isLogListVisible && (