From 52e9341dab01d9fda78eb3e8d50def8651af8e34 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Thu, 6 Mar 2025 21:40:58 +0800 Subject: [PATCH] fix: inappropriate workflow node config unsaved reminder --- ui/src/components/workflow/node/_SharedNode.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/components/workflow/node/_SharedNode.tsx b/ui/src/components/workflow/node/_SharedNode.tsx index fec24a6a..ae981451 100644 --- a/ui/src/components/workflow/node/_SharedNode.tsx +++ b/ui/src/components/workflow/node/_SharedNode.tsx @@ -258,12 +258,13 @@ const SharedNodeConfigDrawer = ({ const handleClose = () => { if (pending) return; - const oldValues = Object.fromEntries(Object.entries(node.config ?? {}).filter(([_, value]) => value !== null && value !== undefined)); - const newValues = Object.fromEntries(Object.entries(getFormValues()).filter(([_, value]) => value !== null && value !== undefined)); + const oldValues = JSON.parse(JSON.stringify(node.config ?? {})); + const newValues = JSON.parse(JSON.stringify(getFormValues())); const changed = !isEqual(oldValues, {}) && !isEqual(oldValues, newValues); const { promise, resolve, reject } = Promise.withResolvers(); if (changed) { + console.log(oldValues, newValues); modalApi.confirm({ title: t("common.text.operation_confirm"), content: t("workflow_node.unsaved_changes.confirm"),