From 9d65c49b8d6baa6a8374bb0b1302fcb9a777ff19 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Wed, 27 Nov 2024 13:27:51 +0600 Subject: [PATCH] fix: hide loading screen on error (#7798) --- src/components/CustomRoadmap/CustomRoadmap.tsx | 9 +++++++++ src/hooks/use-custom-roadmap.ts | 1 + 2 files changed, 10 insertions(+) diff --git a/src/components/CustomRoadmap/CustomRoadmap.tsx b/src/components/CustomRoadmap/CustomRoadmap.tsx index c9e86684d..b8bba0b13 100644 --- a/src/components/CustomRoadmap/CustomRoadmap.tsx +++ b/src/components/CustomRoadmap/CustomRoadmap.tsx @@ -93,6 +93,15 @@ export function CustomRoadmap(props: CustomRoadmapProps) { hideRoadmapLoader(); }, [data]); + useEffect(() => { + if (!error) { + return; + } + + setIsLoading(false); + hideRoadmapLoader(); + }, [error]); + if (isLoading) { return null; } diff --git a/src/hooks/use-custom-roadmap.ts b/src/hooks/use-custom-roadmap.ts index 37a453d5c..2a9858835 100644 --- a/src/hooks/use-custom-roadmap.ts +++ b/src/hooks/use-custom-roadmap.ts @@ -34,6 +34,7 @@ export function useCustomRoadmap(options: UseCustomRoadmapOptions) { return httpGet(roadmapUrl.toString()); }, + retry: false, enabled: !!(slug || id), }, queryClient,