From 442472e412418bc8beb78a34e2d90175d0097b28 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 7 Aug 2019 10:06:56 +0200 Subject: [PATCH] Actually fix masterPlugins visibility The masterPlugins array should not be a global. The ejs templates already have it provided through locals.masterPlugins and plugins get it through onLoadFinish. Make masterPlugins local to master.js again and fix the ejs templates to use locals.masterPlugins. --- master.js | 2 +- static/nav.html | 4 ++-- static/nodes.html | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/master.js b/master.js index db1ef173..38463281 100644 --- a/master.js +++ b/master.js @@ -1012,7 +1012,7 @@ async function getPlugins(){ } -masterPlugins = await getPlugins(); +var masterPlugins = await getPlugins(); io.attach(server); diff --git a/static/nav.html b/static/nav.html index 44f90a62..0787e5d6 100644 --- a/static/nav.html +++ b/static/nav.html @@ -14,8 +14,8 @@ <%# Very ugly ejs code to hide the Players button if the playerManager plugin isn`t installed %> <% sidebarPluginButtonsHtml = ""; - for(let o in masterPlugins){ - let plug = masterPlugins[o]; + for(let o in locals.masterPlugins){ + let plug = locals.masterPlugins[o]; if(plug.main && plug.main.ui && typeof plug.main.ui.sidebar == "object" diff --git a/static/nodes.html b/static/nodes.html index 6fa29a3e..e544dafe 100644 --- a/static/nodes.html +++ b/static/nodes.html @@ -40,8 +40,8 @@ ${findInArray("modName", "remoteMap", slave.mods).length ? "Remote map" : ""} ` - for(let o in masterPlugins){ - let plug = masterPlugins[o]; + for(let o in locals.masterPlugins){ + let plug = locals.masterPlugins[o]; if(plug.main && plug.main.ui && typeof plug.main.ui.slaveListing == "object"