diff --git a/apps/ai-game-creator-shell/src/features/project-workspace/ResourceReferenceInput.tsx b/apps/ai-game-creator-shell/src/features/project-workspace/ResourceReferenceInput.tsx index d8354c565..72524200e 100644 --- a/apps/ai-game-creator-shell/src/features/project-workspace/ResourceReferenceInput.tsx +++ b/apps/ai-game-creator-shell/src/features/project-workspace/ResourceReferenceInput.tsx @@ -763,6 +763,7 @@ function ResourceReferenceEditor({ references: initialDraft?.references ?? [], content: [], }); + const [draftText, setDraftText] = useState(initialDraft?.text ?? ''); const reminderDisabledRef = useRef(reminderDisabled); reminderDisabledRef.current = reminderDisabled; @@ -1007,9 +1008,7 @@ function ResourceReferenceEditor({ aria-label="AI 润色" title="AI 润色" aria-busy={polishing} - disabled={ - disabled || polishing || liveDraftRef.current.text.trim() === '' - } + disabled={disabled || polishing || draftText.trim() === ''} onMouseDown={(event) => event.preventDefault()} onClick={() => void polishPrompt()} > @@ -1215,6 +1214,7 @@ function ResourceReferenceEditor({ onChange={(editorState) => { const nextDraft = readResourceReferenceDraft(editorState); liveDraftRef.current = nextDraft; + setDraftText(nextDraft.text); if (skipInitialDraftChangeRef.current) { skipInitialDraftChangeRef.current = false; return;