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
This commit is contained in:
parent
7cfe5da2f9
commit
e021df94f0
1 changed files with 6 additions and 0 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue