Check for undeployed change before showing open project dialog

This commit is contained in:
Nick O'Leary
2019-01-18 21:42:13 +00:00
parent 4749c92252
commit 7a6e1fe566

View File

@@ -1601,7 +1601,6 @@ RED.projects = (function() {
sendRequest({ sendRequest({
url: "projects/"+name, url: "projects/"+name,
type: "PUT", type: "PUT",
requireCleanWorkspace: true,
responses: { responses: {
200: function(data) { 200: function(data) {
done(null,data); done(null,data);
@@ -2359,7 +2358,15 @@ RED.projects = (function() {
RED.notify(RED._("user.errors.notAuthorized"),"error"); RED.notify(RED._("user.errors.notAuthorized"),"error");
return; return;
} }
show('create',{screen:'open'}) if (RED.nodes.dirty()) {
return requireCleanWorkspace(function(cancelled) {
if (!cancelled) {
show('create',{screen:'open'})
}
})
} else {
show('create',{screen:'open'})
}
}, },
showCredentialsPrompt: function() { //TODO: rename this function showCredentialsPrompt: function() { //TODO: rename this function
if (!RED.user.hasPermission("projects.write")) { if (!RED.user.hasPermission("projects.write")) {