Restructure how editor/git settings are saved in userSettings

This commit is contained in:
Nick O'Leary
2017-12-05 23:50:32 +00:00
parent 3f6b1f6ccb
commit 1840d15397
7 changed files with 200 additions and 262 deletions

View File

@@ -165,17 +165,18 @@ var persistentSettings = {
});
},
getUserSettings: function(username) {
console.log(username);
return userSettings[username];
return clone(userSettings[username]);
},
setUserSettings: function(username,settings) {
var current = userSettings[username];
userSettings[username] = settings;
try {
assert.deepEqual(current,settings);
console.log("skip the save");
return when.resolve();
} catch(err) {
globalSettings.users = userSettings;
console.log("saving");
return storage.saveSettings(globalSettings);
}
}

View File

@@ -53,7 +53,6 @@ Project.prototype.load = function () {
this.credentialSecret = projectSettings.credentialSecret;
this.git = projectSettings.git || { user:{} };
console.log("LOADED",this.git);
// this.paths.flowFile = fspath.join(this.path,"flow.json");
// this.paths.credentialsFile = fspath.join(this.path,"flow_cred.json");