refactor(StorePage): remove unnecessary call to getSavedComponents() in getAllStore() function
fix(StorePage): remove redundant call to getSavedComponents() in onCloseModal() function
This commit is contained in:
parent
6515cc9e06
commit
19887d6887
1 changed files with 1 additions and 6 deletions
|
|
@ -27,8 +27,7 @@ export default function StorePage(): JSX.Element {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTabId("");
|
setTabId("");
|
||||||
}, []);
|
}, []);
|
||||||
const { getSavedComponents, loadingSaved, errorApiKey, hasApiKey } =
|
const { errorApiKey, hasApiKey } = useContext(StoreContext);
|
||||||
useContext(StoreContext);
|
|
||||||
const { setErrorData } = useContext(alertContext);
|
const { setErrorData } = useContext(alertContext);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [loadingTags, setLoadingTags] = useState(true);
|
const [loadingTags, setLoadingTags] = useState(true);
|
||||||
|
|
@ -49,9 +48,6 @@ export default function StorePage(): JSX.Element {
|
||||||
|
|
||||||
function getAllStore() {
|
function getAllStore() {
|
||||||
handleGetComponents();
|
handleGetComponents();
|
||||||
if (hasApiKey) {
|
|
||||||
getSavedComponents();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -124,7 +120,6 @@ export default function StorePage(): JSX.Element {
|
||||||
<div className="community-page-nav-button">
|
<div className="community-page-nav-button">
|
||||||
<StoreApiKeyModal
|
<StoreApiKeyModal
|
||||||
onCloseModal={() => {
|
onCloseModal={() => {
|
||||||
getSavedComponents();
|
|
||||||
handleGetTags();
|
handleGetTags();
|
||||||
handleGetComponents();
|
handleGetComponents();
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue