mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Handle delete of last remote in project settings
This commit is contained in:
parent
44112a9d18
commit
750dd590c8
@ -1254,14 +1254,16 @@ RED.projects.settings = (function() {
|
||||
row.fadeOut(200,function() {
|
||||
remotesList.editableList('removeItem',entry);
|
||||
setTimeout(spinner.remove, 100);
|
||||
if (data.remotes.length === 0) {
|
||||
delete activeProject.git.remotes;
|
||||
remotesList.editableList('addItem',emptyItem);
|
||||
} else {
|
||||
activeProject.git.remotes = {};
|
||||
data.remotes.forEach(function(remote) {
|
||||
var name = remote.name;
|
||||
delete remote.name;
|
||||
activeProject.git.remotes[name] = remote;
|
||||
});
|
||||
if (data.remotes.length === 0) {
|
||||
remotesList.editableList('addItem',emptyItem);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -179,6 +179,7 @@ Project.prototype.loadRemotes = function() {
|
||||
project.branches = {};
|
||||
return project.status();
|
||||
}).then(function() {
|
||||
if (project.remotes) {
|
||||
var allRemotes = Object.keys(project.remotes);
|
||||
var match = "";
|
||||
if (project.branches.remote) {
|
||||
@ -189,6 +190,9 @@ Project.prototype.loadRemotes = function() {
|
||||
});
|
||||
project.currentRemote = project.parseRemoteBranch(project.branches.remote).remote;
|
||||
}
|
||||
} else {
|
||||
delete project.currentRemote;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user