Add checkbox on project-open screen to clear context

This commit is contained in:
Nick O'Leary
2022-01-12 21:05:47 +00:00
parent 3abef972a7
commit 8b43b31c64
5 changed files with 32 additions and 21 deletions

View File

@@ -99,6 +99,7 @@ var api = module.exports = {
* @param {Object} opts
* @param {User} opts.user - the user calling the api
* @param {String} opts.id - the id of the project to activate
* @param {boolean} opts.clearContext - whether to clear context
* @param {Object} opts.req - the request to log (optional)
* @return {Promise<Object>} - resolves when complete
* @memberof @node-red/runtime_projects
@@ -107,7 +108,7 @@ var api = module.exports = {
var currentProject = runtime.storage.projects.getActiveProject(opts.user);
runtime.log.audit({event: "projects.set",id:opts.id}, opts.req);
if (!currentProject || opts.id !== currentProject.name) {
return runtime.storage.projects.setActiveProject(opts.user, opts.id);
return runtime.storage.projects.setActiveProject(opts.user, opts.id, opts.clearContext);
}
},