Skip to content

Commit

Permalink
Merge branch 'fix/conversation-object-var' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
YIXIAO0 committed Dec 5, 2024
2 parents 6f35d87 + 1a96185 commit 4a857bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ const ChatVariableModal = ({
return objectPlaceholder
}, [type])
const getObjectValue = useCallback(() => {
if (!chatVar)
if (!chatVar || Object.keys(chatVar.value).length === 0)
return [DEFAULT_OBJECT_VALUE]

return Object.keys(chatVar.value).map((key) => {
return {
key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from 'reactflow'
import { RiBookOpenLine, RiCloseLine } from '@remixicon/react'
import { useTranslation } from 'react-i18next'
import { ChatVarType } from './type'
import { useStore } from '@/app/components/workflow/store'
import ActionButton, { ActionButtonState } from '@/app/components/base/action-button'
import { BubbleX, LongArrowLeft, LongArrowRight } from '@/app/components/base/icons/src/vender/line/others'
Expand Down Expand Up @@ -65,10 +64,6 @@ const ChatVariablePanel = () => {
}, [getEffectedNodes, store])

const handleEdit = (chatVar: ConversationVariable) => {
// set empty object to be editable
if (chatVar.value_type === ChatVarType.Object && JSON.stringify(chatVar.value) === '{}')
chatVar.value = { '': '' }

setCurrentVar(chatVar)
setShowVariableModal(true)
}
Expand Down

0 comments on commit 4a857bf

Please sign in to comment.