mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 12:37:20 +08:00
add leader restore workflow
This commit is contained in:
parent
b1140301a4
commit
b4636ddf44
@ -19,6 +19,7 @@ import RestoringTitle from './restoring-title'
|
|||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
import { useStore as useAppStore } from '@/app/components/app/store'
|
import { useStore as useAppStore } from '@/app/components/app/store'
|
||||||
import { useInvalidAllLastRun } from '@/service/use-workflow'
|
import { useInvalidAllLastRun } from '@/service/use-workflow'
|
||||||
|
import { collaborationManager } from '../collaboration/core/collaboration-manager'
|
||||||
|
|
||||||
export type HeaderInRestoringProps = {
|
export type HeaderInRestoringProps = {
|
||||||
onRestoreSettled?: () => void
|
onRestoreSettled?: () => void
|
||||||
@ -58,6 +59,9 @@ const HeaderInRestoring = ({
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
message: t('workflow.versionHistory.action.restoreSuccess'),
|
message: t('workflow.versionHistory.action.restoreSuccess'),
|
||||||
})
|
})
|
||||||
|
// Notify other collaboration clients about the workflow restore
|
||||||
|
if (appDetail)
|
||||||
|
collaborationManager.emitWorkflowUpdate(appDetail.id)
|
||||||
},
|
},
|
||||||
onError: () => {
|
onError: () => {
|
||||||
Toast.notify({
|
Toast.notify({
|
||||||
@ -71,7 +75,7 @@ const HeaderInRestoring = ({
|
|||||||
})
|
})
|
||||||
deleteAllInspectVars()
|
deleteAllInspectVars()
|
||||||
invalidAllLastRun()
|
invalidAllLastRun()
|
||||||
}, [setShowWorkflowVersionHistoryPanel, workflowStore, handleSyncWorkflowDraft, deleteAllInspectVars, invalidAllLastRun, t, onRestoreSettled])
|
}, [setShowWorkflowVersionHistoryPanel, workflowStore, handleSyncWorkflowDraft, deleteAllInspectVars, invalidAllLastRun, t, onRestoreSettled, appDetail])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user