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:
parent
9f7fe0545c
commit
90853dda96
2 changed files with 3 additions and 17 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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 {
|
|||
</div>
|
||||
)}
|
||||
|
||||
{noApiKey && (
|
||||
<div className="flex w-full flex-col gap-4 p-4">
|
||||
Try add an API Key :)
|
||||
</div>
|
||||
)}
|
||||
|
||||
{loadingWithApiKey && (
|
||||
<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>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue