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

Fix handling of default workflow mode when projects not active

This commit is contained in:
Nick O'Leary 2021-01-08 15:05:34 +00:00
parent 0f7d185a61
commit 5489bd37c9
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -580,11 +580,13 @@ function saveFlows(flows, user) {
} }
return util.writeFile(flowsFullPath, flowData, flowsFileBackup).then(() => { return util.writeFile(flowsFullPath, flowData, flowsFileBackup).then(() => {
var gitSettings = getUserGitSettings(user) || {}; var gitSettings = getUserGitSettings(user) || {};
var workflowMode = (gitSettings.workflow||{}).mode || settings.editorTheme.projects.workflow.mode; if (activeProject) {
if (activeProject && workflowMode === 'auto') { var workflowMode = (gitSettings.workflow||{}).mode || settings.editorTheme.projects.workflow.mode;
return activeProject.stageFile([flowsFullPath, credentialsFile]).then(() => { if (workflowMode === 'auto') {
return activeProject.commit(user,{message:"Update flow files"}) return activeProject.stageFile([flowsFullPath, credentialsFile]).then(() => {
}) return activeProject.commit(user,{message:"Update flow files"})
})
}
} }
}); });
} }