fix bug with adding duplicate knowntypes

This commit is contained in:
Brenden Tuck 2020-01-19 16:52:28 -05:00
parent 4b961f08e0
commit 712b2ea216

View file

@ -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);