From 74d31f4fad05a13846eee6ed8d1d6a4c849309fd Mon Sep 17 00:00:00 2001 From: Jip Fr Date: Sat, 30 Dec 2023 12:45:10 +0100 Subject: [PATCH] Fix always success --- src/hooks/useProviderScrape.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/useProviderScrape.tsx b/src/hooks/useProviderScrape.tsx index 7e1ab4bf..43328184 100644 --- a/src/hooks/useProviderScrape.tsx +++ b/src/hooks/useProviderScrape.tsx @@ -63,7 +63,8 @@ function useBaseScrape() { const lastIdTmp = lastId.current; setSources((s) => { if (s[id]) s[id].status = "pending"; - if (lastIdTmp && s[lastIdTmp]) s[lastIdTmp].status = "success"; + if (lastIdTmp && s[lastIdTmp] && s[lastIdTmp].status === "pending") + s[lastIdTmp].status = "success"; return { ...s }; }); setCurrentSource(id);