fix: prevent handlePromptChange from clearing examplePromptInfoRef

The ref is now only cleared by onExamplePromptStatusChange(null) which
HomeHero triggers when the user actually edits the text or clicks clear.
This prevents the race where usePromptExample sets the ref and then
onPromptChange immediately clears it in the same tick.
This commit is contained in:
qiongyu1999 2026-05-30 16:12:54 +08:00
parent 83186728f0
commit a4162f8063

View file

@ -891,7 +891,6 @@ export function HomeView({
function handlePromptChange(nextPrompt: string) {
setPrompt(nextPrompt);
setPromptEditedByUser(true);
examplePromptInfoRef.current = null;
if (!active?.queryTemplate) return;
const extracted = extractPluginInputsFromPrompt(
active.queryTemplate,