Showing
1 changed file
with
8 additions
and
3 deletions
| @@ -73,7 +73,12 @@ const InputBar: React.FC<InputBarProps> = ({ onGenerate, isGenerating, incomingP | @@ -73,7 +73,12 @@ const InputBar: React.FC<InputBarProps> = ({ onGenerate, isGenerating, incomingP | ||
| 73 | }; | 73 | }; |
| 74 | 74 | ||
| 75 | const handleGenerate = async () => { | 75 | const handleGenerate = async () => { |
| 76 | - if (!prompt.trim() || isGenerating || isSubmittingLocal) return; | 76 | + if (isGenerating || isSubmittingLocal) return; |
| 77 | + | ||
| 78 | + if (!prompt.trim()) { | ||
| 79 | + alert("请描述您的创意内容"); | ||
| 80 | + return; | ||
| 81 | + } | ||
| 77 | 82 | ||
| 78 | if (isVideoMode && !imageFile) { | 83 | if (isVideoMode && !imageFile) { |
| 79 | alert("请上传一张图片以生成视频。"); | 84 | alert("请上传一张图片以生成视频。"); |
| @@ -312,10 +317,10 @@ const InputBar: React.FC<InputBarProps> = ({ onGenerate, isGenerating, incomingP | @@ -312,10 +317,10 @@ const InputBar: React.FC<InputBarProps> = ({ onGenerate, isGenerating, incomingP | ||
| 312 | 317 | ||
| 313 | <button | 318 | <button |
| 314 | onClick={handleGenerate} | 319 | onClick={handleGenerate} |
| 315 | - disabled={!prompt.trim() || isGenerating || isSubmittingLocal || (isVideoMode && !imageFile)} | 320 | + disabled={isGenerating || isSubmittingLocal} |
| 316 | className={` | 321 | className={` |
| 317 | flex items-center justify-center w-10 h-10 md:w-12 md:h-12 rounded-full transition-all duration-200 | 322 | flex items-center justify-center w-10 h-10 md:w-12 md:h-12 rounded-full transition-all duration-200 |
| 318 | - ${(prompt.trim() && !isGenerating && (!isVideoMode || imageFile)) | 323 | + ${(!isGenerating && !isSubmittingLocal) |
| 319 | ? 'bg-black dark:bg-white text-white dark:text-black hover:scale-105 active:scale-95 shadow-md' | 324 | ? 'bg-black dark:bg-white text-white dark:text-black hover:scale-105 active:scale-95 shadow-md' |
| 320 | : 'bg-gray-200 dark:bg-gray-700 text-gray-400 cursor-not-allowed'} | 325 | : 'bg-gray-200 dark:bg-gray-700 text-gray-400 cursor-not-allowed'} |
| 321 | `} | 326 | `} |
-
Please register or login to post a comment