From 58e5c179a0cc23985486d99a780cf47bdf4bb907 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 13 Nov 2023 15:18:30 -0300 Subject: [PATCH] fix(StoreApiKeyModal/index.tsx): fix typo in import statement for StoreContext feat(StoreApiKeyModal/index.tsx): add support for checking if an API key exists in the StoreContext fix(market-card.tsx): remove unnecessary code for handling installable market cards --- src/frontend/src/modals/StoreApiKeyModal/index.tsx | 4 ++++ src/frontend/src/pages/StorePage/components/market-card.tsx | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/modals/StoreApiKeyModal/index.tsx b/src/frontend/src/modals/StoreApiKeyModal/index.tsx index 4a080ade3..915d6e310 100644 --- a/src/frontend/src/modals/StoreApiKeyModal/index.tsx +++ b/src/frontend/src/modals/StoreApiKeyModal/index.tsx @@ -6,6 +6,7 @@ import { Input } from "../../components/ui/input"; import { CONTROL_NEW_API_KEY } from "../../constants/constants"; import { alertContext } from "../../contexts/alertContext"; import { AuthContext } from "../../contexts/authContext"; +import { StoreContext } from "../../contexts/storeContext"; import { addApiKeyStore } from "../../controllers/API"; import { ApiKeyInputType, @@ -25,6 +26,7 @@ export default function StoreApiKeyModal({ const { setSuccessData, setErrorData } = useContext(alertContext); const inputRef = useRef(null); const { storeApiKey } = useContext(AuthContext); + const { hasApiKey } = useContext(StoreContext); function handleInput({ target: { name, value }, @@ -86,6 +88,8 @@ export default function StoreApiKeyModal({
{ handleInput({ target: { name: "apikey", value } }); diff --git a/src/frontend/src/pages/StorePage/components/market-card.tsx b/src/frontend/src/pages/StorePage/components/market-card.tsx index f6edc5131..90472a9b6 100644 --- a/src/frontend/src/pages/StorePage/components/market-card.tsx +++ b/src/frontend/src/pages/StorePage/components/market-card.tsx @@ -238,8 +238,6 @@ export const MarketCardComponent = ({ } if (!added) { handleAdd(); - } else if (installable) { - handleInstall(); } }} >