Merge branch 'master' into dev

This commit is contained in:
Nick O'Leary
2018-10-07 11:45:43 +01:00
5 changed files with 20 additions and 7 deletions

View File

@@ -320,9 +320,9 @@ RED.palette = (function() {
}
setLabel(nt,$(d),label,nodeInfo);
var categoryNode = $("#palette-container-"+category);
var categoryNode = $("#palette-container-"+rootCategory);
if (categoryNode.find(".palette_node").length === 1) {
categoryContainers[category].open();
categoryContainers[rootCategory].open();
}
}

View File

@@ -461,7 +461,11 @@ RED.projects.settings = (function() {
setTimeout(function() {
depsList.editableList('removeItem',entry);
refreshModuleInUseCounts();
entry.count = modulesInUse[entry.id].count;
if (modulesInUse.hasOwnProperty(entry.id)) {
entry.count = modulesInUse[entry.id].count;
} else {
entry.count = 0;
}
depsList.editableList('addItem',entry);
},500);
}

View File

@@ -358,7 +358,15 @@ Project.prototype.update = function (user, data) {
promises.push(util.writeFile(this.paths['README.md'], this.description));
}
if (savePackage) {
promises.push(util.writeFile(this.paths['package.json'], JSON.stringify(this.package,"",4)));
promises.push(fs.readFile(project.paths['package.json'],"utf8").then(content => {
var currentPackage = {};
try {
currentPackage = util.parseJSON(content);
} catch(err) {
}
this.package = Object.assign(currentPackage,this.package);
return util.writeFile(this.paths['package.json'], JSON.stringify(this.package,"",4));
}));
}
return when.settle(promises).then(function(res) {
return {