mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 03:32:23 +08:00
fix: read llm node's first prompt role by optional chaining (#4510)
This commit is contained in:
parent
46bd53a929
commit
5440108431
|
@ -146,7 +146,7 @@ const ConfigPrompt: FC<Props> = ({
|
|||
<ReactSortable className="space-y-1"
|
||||
list={payloadWithIds}
|
||||
setList={(list) => {
|
||||
if ((payload as PromptItem[])?.[0].role === PromptRole.system && list[0].p?.role !== PromptRole.system)
|
||||
if ((payload as PromptItem[])?.[0]?.role === PromptRole.system && list[0].p?.role !== PromptRole.system)
|
||||
return
|
||||
|
||||
onChange(list.map(item => item.p))
|
||||
|
|
Loading…
Reference in New Issue
Block a user