MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / checkIfHasChanged

Function checkIfHasChanged

packages/ui/src/views/canvas/index.jsx:458–477  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

456 // check if chatflow has changed before saving
457 useEffect(() => {
458 const checkIfHasChanged = async () => {
459 if (getHasChatflowChangedApi.data?.hasChanged === true) {
460 const confirmPayload = {
461 title: `Confirm Change`,
462 description: `${canvasTitle} ${chatflow.name} has changed since you have opened, overwrite changes?`,
463 confirmButtonName: 'Confirm',
464 cancelButtonName: 'Cancel'
465 }
466 const isConfirmed = await confirm(confirmPayload)
467
468 if (!isConfirmed) {
469 return
470 }
471 }
472 const updateBody = {
473 name: chatflowName,
474 flowData
475 }
476 updateChatflowApi.request(chatflow.id, updateBody)
477 }
478
479 if (getHasChatflowChangedApi.data) {
480 checkIfHasChanged()

Callers 1

CanvasFunction · 0.85

Calls 1

confirmFunction · 0.85

Tested by

no test coverage detected