File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed
ai/ai-react-app/src/components/Layout Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -46,16 +46,7 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({
4646 ? { parts : [ { text : newInstructionText } ] }
4747 : undefined ;
4848
49- const currentInstruction = prevParams . systemInstruction ;
50- const currentInstructionText =
51- currentInstruction &&
52- typeof currentInstruction === "object" &&
53- "parts" in currentInstruction &&
54- Array . isArray ( currentInstruction . parts ) &&
55- currentInstruction . parts . length > 0 &&
56- "text" in currentInstruction . parts [ 0 ]
57- ? currentInstruction . parts [ 0 ] . text
58- : undefined ;
49+ const currentInstructionText = prevParams . systemInstruction ?. parts ?. [ 0 ] ?. text ;
5950
6051 // Only update if the text content has actually changed.
6152 if ( ( newInstructionText || "" ) !== ( currentInstructionText || "" ) ) {
You can’t perform that action at this time.
0 commit comments