From e021df94f0a16016812acbe1d4b0db613f0a3c02 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Fri, 17 Nov 2023 01:23:02 -0300 Subject: [PATCH] fix(StorePage/index.tsx): set validApiKey to true in useEffect to fix missing data bug fix(StorePage/index.tsx): handle unauthorized response and set validApiKey to false to handle invalid API key error --- src/frontend/src/pages/StorePage/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/frontend/src/pages/StorePage/index.tsx b/src/frontend/src/pages/StorePage/index.tsx index 83c1227a3..039f675dc 100644 --- a/src/frontend/src/pages/StorePage/index.tsx +++ b/src/frontend/src/pages/StorePage/index.tsx @@ -61,6 +61,7 @@ export default function StorePage(): JSX.Element { useEffect(() => { handleGetComponents(); + setValidApiKey(true); }, [ tabActive, pageOrder, @@ -97,6 +98,11 @@ export default function StorePage(): JSX.Element { filterByUser: selectFilter === "createdbyme" && validApiKey ? true : null, }) .then((res) => { + if (res?.authorized === false && validApiKey === false) { + setValidApiKey(false); + return; + } + setLoading(false); setSearchData(res?.results ?? []); setTotalRowsCount(