From 712b2ea216bb39211f3367ba93220b41da40978c Mon Sep 17 00:00:00 2001 From: Brenden Tuck Date: Sun, 19 Jan 2020 16:52:28 -0500 Subject: [PATCH] fix bug with adding duplicate knowntypes --- .../static/webclient/js/plugins/goldenlayout.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js b/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js index d1409ab3f7..cbf5217730 100644 --- a/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js +++ b/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js @@ -383,6 +383,14 @@ let goldenlayout = (function () { // Public // + // + // helper accessor for other plugins to add new known-message types + var addKnownType = function (newtype) { + if( knownTypes.includes(newtype) == false ) { + knownTypes.push(newtype); + } + } + // // @@ -526,7 +534,7 @@ let goldenlayout = (function () { onKeydown: onKeydown, onText: onText, getGL: function () { return myLayout; }, - addKnownType: function (newtype) { knownTypes.push(newtype); }, + addKnownType: addKnownType, } }()); window.plugin_handler.add("goldenlayout", goldenlayout);