From ebd62a4112d17dc6a1cc367990c4b100946d1586 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 28 Dec 2021 10:29:42 +0000 Subject: [PATCH] Fix storing hidden tab state when not hidden via action Fixes #3305 --- .../editor-client/src/js/ui/workspaces.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js index 0082b7aed..46835a032 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js @@ -208,10 +208,20 @@ RED.workspaces = (function() { }, onhide: function(tab) { hideStack.push(tab.id); + + var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}"); + hiddenTabs[tab.id] = true; + RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs)); + RED.events.emit("workspace:hide",{workspace: tab.id}) }, onshow: function(tab) { removeFromHideStack(tab.id); + + var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}"); + delete hiddenTabs[tab.id]; + RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs)); + RED.events.emit("workspace:show",{workspace: tab.id}) }, minimumActiveTabWidth: 150, @@ -542,9 +552,6 @@ RED.workspaces = (function() { } if (workspace_tabs.contains(id)) { workspace_tabs.hideTab(id); - var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}"); - hiddenTabs[id] = true; - RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs)); } }, isHidden: function(id) { @@ -572,9 +579,6 @@ RED.workspaces = (function() { } workspace_tabs.activateTab(id); } - var hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}"); - delete hiddenTabs[id]; - RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs)); }, refresh: function() { RED.nodes.eachWorkspace(function(ws) {