Fix bug with clearing custom instructions

This commit is contained in:
Matt Rubens
2025-01-14 16:01:59 -05:00
parent 4493b55276
commit f2d25dd5a5
3 changed files with 35 additions and 2 deletions

View File

@@ -21,7 +21,8 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
enhancementApiConfigId,
setEnhancementApiConfigId,
mode,
customInstructions
customInstructions,
setCustomInstructions
} = useExtensionState()
const [testPrompt, setTestPrompt] = useState('')
const [isEnhancing, setIsEnhancing] = useState(false)
@@ -152,6 +153,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
value={customInstructions ?? ''}
onChange={(e) => {
const value = (e as CustomEvent)?.detail?.target?.value || ((e as any).target as HTMLTextAreaElement).value
setCustomInstructions(value || undefined)
vscode.postMessage({
type: "customInstructions",
text: value.trim() || undefined