mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +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"
|
<ReactSortable className="space-y-1"
|
||||||
list={payloadWithIds}
|
list={payloadWithIds}
|
||||||
setList={(list) => {
|
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
|
return
|
||||||
|
|
||||||
onChange(list.map(item => item.p))
|
onChange(list.map(item => item.p))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user