mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 13:39:53 +00:00
fix: inappropriate workflow node config unsaved reminder
This commit is contained in:
parent
411c39b148
commit
52e9341dab
@ -258,12 +258,13 @@ const SharedNodeConfigDrawer = ({
|
|||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
if (pending) return;
|
if (pending) return;
|
||||||
|
|
||||||
const oldValues = Object.fromEntries(Object.entries(node.config ?? {}).filter(([_, value]) => value !== null && value !== undefined));
|
const oldValues = JSON.parse(JSON.stringify(node.config ?? {}));
|
||||||
const newValues = Object.fromEntries(Object.entries(getFormValues()).filter(([_, value]) => value !== null && value !== undefined));
|
const newValues = JSON.parse(JSON.stringify(getFormValues()));
|
||||||
const changed = !isEqual(oldValues, {}) && !isEqual(oldValues, newValues);
|
const changed = !isEqual(oldValues, {}) && !isEqual(oldValues, newValues);
|
||||||
|
|
||||||
const { promise, resolve, reject } = Promise.withResolvers();
|
const { promise, resolve, reject } = Promise.withResolvers();
|
||||||
if (changed) {
|
if (changed) {
|
||||||
|
console.log(oldValues, newValues);
|
||||||
modalApi.confirm({
|
modalApi.confirm({
|
||||||
title: t("common.text.operation_confirm"),
|
title: t("common.text.operation_confirm"),
|
||||||
content: t("workflow_node.unsaved_changes.confirm"),
|
content: t("workflow_node.unsaved_changes.confirm"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user