From a745ddc16490d350433c6a03067a7cbcd25311cd Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 13 May 2024 14:33:35 +0100 Subject: [PATCH] Fix linting --- .../@node-red/editor-client/src/js/history.js | 22 +++++++++---------- .../editor-client/src/js/ui/notifications.js | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/history.js b/packages/node_modules/@node-red/editor-client/src/js/history.js index 66411264b..2fa4e4427 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/history.js +++ b/packages/node_modules/@node-red/editor-client/src/js/history.js @@ -29,7 +29,14 @@ RED.history = (function() { } return RED.nodes.junction(id); } - + function ensureUnlocked(id, flowsToLock) { + const flow = id && (RED.nodes.workspace(id) || RED.nodes.subflow(id) || null); + const isLocked = flow ? flow.locked : false; + if (flow && isLocked) { + flow.locked = false; + flowsToLock.add(flow) + } + } function undoEvent(ev) { var i; var len; @@ -78,21 +85,14 @@ RED.history = (function() { RED.nodes.dirty(false); const flowsToLock = new Set() - function ensureUnlocked(id) { - const flow = id && (RED.nodes.workspace(id) || RED.nodes.subflow(id) || null); - const isLocked = flow ? flow.locked : false; - if (flow && isLocked) { - flow.locked = false; - flowsToLock.add(flow) - } - } + imported.nodes.forEach(function(n) { if (ev.changed[n.id]) { - ensureUnlocked(n.z) + ensureUnlocked(n.z, flowsToLock) n.changed = true; } if (ev.moved[n.id]) { - ensureUnlocked(n.z) + ensureUnlocked(n.z, flowsToLock) n.moved = true; } }) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/notifications.js b/packages/node_modules/@node-red/editor-client/src/js/ui/notifications.js index ef75ff8c4..d68d03d3f 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/notifications.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/notifications.js @@ -223,7 +223,7 @@ RED.notifications = (function() { } newTimeout = newOptions.hasOwnProperty('timeout')?newOptions.timeout:timeout if (!fixed || newOptions.fixed === false) { - newTimeout === newTimeout || 5000 + newTimeout = newTimeout || 5000 } if (newOptions.buttons) { var buttonSet = $('
').appendTo(nn)