Skip to content

Commit 27a4c74

Browse files
fixed promt selector change not being shown to the user
1 parent 32000ce commit 27a4c74

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/client/components/ChatV2/AssistantInstructionsInput.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { TextField, Typography } from '@mui/material'
22
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff'
3+
import { useEffect } from 'react'
34

45
const VisibilityOff = () => (
56
<div style={{ display: 'flex', alignItems: 'center' }}>
@@ -25,6 +26,9 @@ export default function AssistantInstructionsInput({
2526
setInstructions: (instructions: string) => void
2627
instructionsInputFieldRef: any
2728
}): JSX.Element {
29+
useEffect(() => {
30+
instructionsInputFieldRef.current.value = instructions //this change will be seen since the assistantInstructions is also updated
31+
}, [instructions])
2832
return hidden ? (
2933
<TextField disabled={true} label={<VisibilityOff />} />
3034
) : (

0 commit comments

Comments
 (0)