better store and disabling

This commit is contained in:
caranicas 2022-09-16 12:56:57 -04:00
parent b21ec7a302
commit cf12abfc7f
4 changed files with 14 additions and 4 deletions

View File

@ -14,6 +14,7 @@ export default function MakeButton() {
const parallelCount = useImageCreate((state) => state.parallelCount);
const builtRequest = useImageCreate((state) => state.builtRequest);
const addNewImage = useImageQueue((state) => state.addNewImage);
const hasQueue = useImageQueue((state) => state.hasQueuedImages());
const isRandomSeed = useImageCreate((state) => state.isRandomSeed());
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
@ -72,7 +73,11 @@ export default function MakeButton() {
};
return (
<button className={MakeButtonStyle} onClick={makeImages}>
<button
className={MakeButtonStyle}
onClick={makeImages}
disabled={hasQueue}
>
Make
</button>
);

View File

@ -8,4 +8,8 @@ export const MakeButtonStyle = style({
color: "white",
padding: "8px",
borderRadius: "5px",
':disabled': {
backgroundColor: "rgb(38, 77, 141, 0.5)",
},
});

View File

@ -103,14 +103,16 @@ export default function DisplayPanel() {
<div className={displayContainer}>
<div className={CurrentDisplay}>
{/* TODO Put the in painting controls here */}
{/* <DrawImage imageData={completedImages[0].data}></DrawImage> */}
<GeneratedImage
key={completedImages[0].id}
imageData={completedImages[0].data}
metadata={completedImages[0].info}
/>
{/* TODO Put the in painting controls here */}
<DrawImage imageData={completedImages[0].data}></DrawImage>
</div>
<div className={previousImages}>

View File

@ -66,7 +66,6 @@ type ModifiersList = string[];
type ModifiersOptions = string | ModifiersList[];
type ModifiersOptionList = ModifiersOptions[];
interface ImageCreateState {
parallelCount: number;
requestOptions: ImageRequest;