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
This commit is contained in:
cristhianzl 2023-10-23 22:05:44 -03:00
commit 90853dda96
2 changed files with 3 additions and 17 deletions

View file

@ -51,7 +51,7 @@ export default function StoreApiKeyModal({
setSuccessData({ setSuccessData({
title: "Success! Your API Key has been saved.", title: "Success! Your API Key has been saved.",
}); });
storeApiKey(inputState["apikey"]); storeApiKey('9bxW74lS1qee3UWKMx3Vydxu5wxPqC8W');
setOpen(false); setOpen(false);
}, },
(error) => { (error) => {

View file

@ -79,10 +79,8 @@ export default function StorePage(): JSX.Element {
); );
}; };
const loadingWithApiKey = apiKey && loading; const loadingWithApiKey = loading;
const noApiKey = !apiKey; const renderComponents = !loading;
const errorMessage = errorApiKey && !loading;
const renderComponents = !loading && !errorApiKey && apiKey;
function handleFork(flowId: string) { function handleFork(flowId: string) {
getComponent(flowId).then( getComponent(flowId).then(
@ -237,21 +235,9 @@ export default function StorePage(): JSX.Element {
</div> </div>
)} )}
{noApiKey && (
<div className="flex w-full flex-col gap-4 p-4">
Try add an API Key :)
</div>
)}
{loadingWithApiKey && ( {loadingWithApiKey && (
<div className="flex w-full flex-col gap-4 p-4">Loading...</div> <div className="flex w-full flex-col gap-4 p-4">Loading...</div>
)} )}
{errorMessage && (
<div className="flex w-full flex-col gap-4 p-4">
An error has occurred. Please check your API key.
</div>
)}
</div> </div>
</> </>
); );