mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 04:26:30 +08:00
save draft when delivery method changed
This commit is contained in:
parent
ac46cf499f
commit
d65523aa0b
@ -7,6 +7,7 @@ import { produce } from 'immer'
|
|||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Tooltip from '@/app/components/base/tooltip'
|
import Tooltip from '@/app/components/base/tooltip'
|
||||||
|
import { useNodesSyncDraft } from '@/app/components/workflow/hooks'
|
||||||
import MethodItem from './method-item'
|
import MethodItem from './method-item'
|
||||||
import MethodSelector from './method-selector'
|
import MethodSelector from './method-selector'
|
||||||
import UpgradeModal from './upgrade-modal'
|
import UpgradeModal from './upgrade-modal'
|
||||||
@ -35,6 +36,7 @@ const DeliveryMethodForm: React.FC<Props> = ({
|
|||||||
readonly,
|
readonly,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const { handleSyncWorkflowDraft } = useNodesSyncDraft()
|
||||||
|
|
||||||
const handleMethodChange = (target: DeliveryMethod) => {
|
const handleMethodChange = (target: DeliveryMethod) => {
|
||||||
const newMethods = produce(value, (draft) => {
|
const newMethods = produce(value, (draft) => {
|
||||||
@ -43,6 +45,7 @@ const DeliveryMethodForm: React.FC<Props> = ({
|
|||||||
draft[index] = target
|
draft[index] = target
|
||||||
})
|
})
|
||||||
onChange(newMethods)
|
onChange(newMethods)
|
||||||
|
handleSyncWorkflowDraft(true, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleMethodAdd = (newMethod: DeliveryMethod) => {
|
const handleMethodAdd = (newMethod: DeliveryMethod) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user