diff --git a/web/app/components/workflow/nodes/llm/components/memory-system/hooks.ts b/web/app/components/workflow/nodes/llm/components/memory-system/hooks.ts index 9f1d1bed78..593280b531 100644 --- a/web/app/components/workflow/nodes/llm/components/memory-system/hooks.ts +++ b/web/app/components/workflow/nodes/llm/components/memory-system/hooks.ts @@ -14,7 +14,7 @@ export const useMemory = ( id: string, data: LLMNodeType, ) => { - const { memory } = data + const { memory = {} as Memory } = data const initCollapsed = useMemo(() => { if (!memory?.enabled) return true @@ -81,7 +81,7 @@ export const useMemory = ( return 'block' } else { - if (memory?.window.enabled) + if (memory?.window?.enabled) return 'linear' return 'disabled' diff --git a/web/app/components/workflow/nodes/llm/components/memory-system/linear-memory.tsx b/web/app/components/workflow/nodes/llm/components/memory-system/linear-memory.tsx index f85bd1ad7e..6d1aaf4434 100644 --- a/web/app/components/workflow/nodes/llm/components/memory-system/linear-memory.tsx +++ b/web/app/components/workflow/nodes/llm/components/memory-system/linear-memory.tsx @@ -122,59 +122,59 @@ const LinearMemory = ({ return ( <> -