From a695b6701efdc5a8f904119b6b51e8277244f58f Mon Sep 17 00:00:00 2001 From: Ian Krieger Date: Wed, 20 Sep 2023 13:59:26 -0400 Subject: [PATCH] fix: clear interval on status other than 403 --- src/components/Assets/hooks/useGetImagePreviewUrl.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Assets/hooks/useGetImagePreviewUrl.ts b/src/components/Assets/hooks/useGetImagePreviewUrl.ts index 0ac5cea7..d1caee71 100644 --- a/src/components/Assets/hooks/useGetImagePreviewUrl.ts +++ b/src/components/Assets/hooks/useGetImagePreviewUrl.ts @@ -27,6 +27,7 @@ export function useGetImagePreviewUrl(props: { url: string }) { } if (result.status !== 403) { + clearInterval(intrvl); reject(new Error("Unable to fetch image")); } }, 5000);