Skip to content

Commit

Permalink
if image was loaded then consider regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
CGastrell committed Dec 20, 2024
1 parent 4cd1161 commit 6e1e36c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default function FeaturedImage( {
style: style,
} );

setCurrent( crrt => crrt + 1 );
setCurrent( () => images.length );
processImageGeneration( {
userPrompt,
postContent: postTitle + '\n\n' + postContent,
Expand All @@ -228,6 +228,7 @@ export default function FeaturedImage( {
postTitle,
postContent,
notEnoughRequests,
images,
]
);

Expand Down Expand Up @@ -398,7 +399,9 @@ export default function FeaturedImage( {
placement={ placement }
onClose={ handleModalClose }
onTryAgain={ handleTryAgain }
onGenerate={ pointer?.current > 0 ? handleRegenerate : handleGenerate }
onGenerate={
pointer?.current > 0 || postFeaturedMediaId ? handleRegenerate : handleGenerate
}
generating={ currentPointer?.generating }
notEnoughRequests={ notEnoughRequests }
requireUpgrade={ requireUpgrade }
Expand Down

0 comments on commit 6e1e36c

Please sign in to comment.