Compare commits

...

2 Commits

1 changed files with 3 additions and 2 deletions

View File

@ -47,6 +47,7 @@ export default function Create() {
// 提交处理
const handleSubmit = async () => {
console.log('handleSubmit', template?.imageCount, image1, image2, prompt);
if (!isLoggedIn) {
setLoginRedirecting(true);
setLoading(true);
@ -57,7 +58,7 @@ export default function Create() {
alert('Template code not set');
return;
}
if (template?.imageCount && !image1 || (template?.imageCount === 2 && !image2)) {
if ((template?.imageCount && !image1) || (template?.imageCount === 2 && !image2)) {
alert('Upload two images');
return;
}
@ -153,7 +154,7 @@ export default function Create() {
<div className="submit-section">
<button
className={`submit-button ${(!image1 || (template?.imageCount === 2 && !image2) || loading) && isLoggedIn ? 'disabled' : ''}`}
disabled={(!image1 || (template?.imageCount === 2 && !image2) || loading) && isLoggedIn}
disabled={((template?.imageCount && !image1) || (template?.imageCount === 2 && !image2) || loading) && isLoggedIn}
onClick={handleSubmit}
>
{isLoggedIn === false ? (