From 90853dda969a2af4ef7aef47f96a89a8f500e7e4 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Mon, 23 Oct 2023 22:05:44 -0300 Subject: [PATCH] fix(modals): hardcode API key in StoreApiKeyModal to a specific value for testing purposes refactor(pages): simplify conditional rendering logic in StorePage by removing unnecessary variables and error message display --- .../src/modals/StoreApiKeyModal/index.tsx | 2 +- src/frontend/src/pages/StorePage/index.tsx | 18 ++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/frontend/src/modals/StoreApiKeyModal/index.tsx b/src/frontend/src/modals/StoreApiKeyModal/index.tsx index c2d90fc3a..2d1a22be5 100644 --- a/src/frontend/src/modals/StoreApiKeyModal/index.tsx +++ b/src/frontend/src/modals/StoreApiKeyModal/index.tsx @@ -51,7 +51,7 @@ export default function StoreApiKeyModal({ setSuccessData({ title: "Success! Your API Key has been saved.", }); - storeApiKey(inputState["apikey"]); + storeApiKey('9bxW74lS1qee3UWKMx3Vydxu5wxPqC8W'); setOpen(false); }, (error) => { diff --git a/src/frontend/src/pages/StorePage/index.tsx b/src/frontend/src/pages/StorePage/index.tsx index 1699ad3fd..86e1a1bff 100644 --- a/src/frontend/src/pages/StorePage/index.tsx +++ b/src/frontend/src/pages/StorePage/index.tsx @@ -79,10 +79,8 @@ export default function StorePage(): JSX.Element { ); }; - const loadingWithApiKey = apiKey && loading; - const noApiKey = !apiKey; - const errorMessage = errorApiKey && !loading; - const renderComponents = !loading && !errorApiKey && apiKey; + const loadingWithApiKey = loading; + const renderComponents = !loading; function handleFork(flowId: string) { getComponent(flowId).then( @@ -237,21 +235,9 @@ export default function StorePage(): JSX.Element { )} - {noApiKey && ( -
- Try add an API Key :) -
- )} - {loadingWithApiKey && (
Loading...
)} - - {errorMessage && ( -
- An error has occurred. Please check your API key. -
- )} );