1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #3464 from Steve-Mcl/dont-show-hidden-tab

Dont show 1st tab if hidden when loading
This commit is contained in:
Nick O'Leary 2022-03-03 23:15:07 +00:00 committed by GitHub
commit fdb868516f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,8 +252,21 @@ var RED = (function() {
if (/^#flow\/.+$/.test(currentHash)) { if (/^#flow\/.+$/.test(currentHash)) {
RED.workspaces.show(currentHash.substring(6),true); RED.workspaces.show(currentHash.substring(6),true);
} }
if (RED.workspaces.active() === 0 && RED.workspaces.count() > 0) { if (RED.workspaces.count() > 0) {
RED.workspaces.show(RED.nodes.getWorkspaceOrder()[0]) const hiddenTabs = JSON.parse(RED.settings.getLocal("hiddenTabs")||"{}");
const workspaces = RED.nodes.getWorkspaceOrder();
if (RED.workspaces.active() === 0) {
for (let index = 0; index < workspaces.length; index++) {
const ws = workspaces[index];
if (!hiddenTabs[ws]) {
RED.workspaces.show(ws);
break;
}
}
}
if (RED.workspaces.active() === 0) {
RED.workspaces.show(workspaces[0]);
}
} }
} catch(err) { } catch(err) {
console.warn(err); console.warn(err);