mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix adding users to history if multiple props modified
This commit is contained in:
parent
53e092e484
commit
ed4b98b598
@ -1534,6 +1534,7 @@ RED.editor = (function() {
|
||||
if (scope) {
|
||||
const newUsers = editing_config_node.users.filter(function (node) {
|
||||
let keepNode = false;
|
||||
let nodeModified = null;
|
||||
|
||||
for (const d in node._def.defaults) {
|
||||
if (node._def.defaults.hasOwnProperty(d)) {
|
||||
@ -1544,15 +1545,19 @@ RED.editor = (function() {
|
||||
// this config node in the correct scope.
|
||||
keepNode = true;
|
||||
} else {
|
||||
historyEvents.push({
|
||||
t: "edit",
|
||||
node: node,
|
||||
changes: { [d]: node[d] },
|
||||
changed: node.changed,
|
||||
dirty: node.dirty
|
||||
});
|
||||
if (!nodeModified) {
|
||||
nodeModified = {
|
||||
t: "edit",
|
||||
node: node,
|
||||
changes: { [d]: node[d] },
|
||||
changed: node.changed,
|
||||
dirty: node.dirty
|
||||
};
|
||||
} else {
|
||||
nodeModified.changes[d] = node[d];
|
||||
}
|
||||
|
||||
// Remove the reference to the config
|
||||
// Remove the reference to the config node
|
||||
node[d] = "";
|
||||
}
|
||||
}
|
||||
@ -1560,6 +1565,11 @@ RED.editor = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
// Add the node modified to the history
|
||||
if (nodeModified) {
|
||||
historyEvents.push(nodeModified);
|
||||
}
|
||||
|
||||
// Mark as changed and revalidate this node
|
||||
if (!keepNode) {
|
||||
node.changed = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user