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

Only delete node type from registry if id matches

If a node is moved out of node-red core to an npm installable
package, the first time NR runs after the move it correctly
deletes the node-red version from the registry. However it was
also removing the node constructors registered by the new
npm installed version as it wasn't checking what it was removing
came from the now-removed node.
This commit is contained in:
Nick O'Leary 2015-06-08 16:32:50 +01:00
parent 369eae3d92
commit c5d8e09b41

View File

@ -188,8 +188,11 @@ function removeNode(id) {
nodeList.splice(i,1);
}
config.types.forEach(function(t) {
delete nodeConstructors[t];
delete nodeTypeToId[t];
var typeId = nodeTypeToId[t];
if (typeId === id) {
delete nodeConstructors[t];
delete nodeTypeToId[t];
}
});
config.enabled = false;
config.loaded = false;