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

Changed cleanNodeList to cleanModuleList

This commit is contained in:
Anna Thomas 2014-11-26 16:41:31 +00:00
parent bb6e27f662
commit 8f2a0b63d9
3 changed files with 11 additions and 6 deletions

View File

@ -129,7 +129,7 @@ module.exports = {
getNodeConfig: registry.getNodeConfig,
clearRegistry: registry.clear,
cleanNodeList: registry.cleanNodeList,
cleanModuleList: registry.cleanModuleList,
// Flow handling
loadFlows: flows.load,

View File

@ -372,16 +372,21 @@ var registry = (function() {
saveNodeList: saveNodeList,
cleanNodeList: function() {
cleanModuleList: function() {
var removed = false;
for (var mod in moduleConfigs) {
if (moduleConfigs.hasOwnProperty(mod)) {
if (moduleConfigs[mod] && !moduleNodes[mod]) {
registry.removeNode(id);
var nodes = moduleConfigs[mod].nodes;
for (var node in nodes) {
if (nodes.hasOwnProperty(node)) {
registry.removeNode(mod+"/"+node);
removed = true;
}
}
}
}
}
if (removed) {
saveNodeList();
}
@ -775,5 +780,5 @@ module.exports = {
addModule: addModule,
removeModule: registry.removeModule,
cleanNodeList: registry.cleanNodeList
cleanModuleList: registry.cleanModuleList
};

View File

@ -91,7 +91,7 @@ function start() {
}
if (!settings.autoInstallModules) {
util.log("[red] Removing modules from config");
redNodes.cleanNodeList();
redNodes.cleanModuleList();
}
}
defer.resolve();