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:
anovazzi1 2023-11-14 16:00:26 -03:00
commit 19887d6887

View file

@ -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();
}} }}