Correction sauvegarde de profil modifié via éditeur, fixes #2

This commit is contained in:
wpetit 2016-03-03 11:05:43 +01:00
parent 4d2891f9b6
commit a47635c675
1 changed files with 2 additions and 8 deletions

View File

@ -62,19 +62,13 @@ exports.saveProfile = function(destPath, profile) {
logger.info('Saving profile to "%s"...', destPath); logger.info('Saving profile to "%s"...', destPath);
var cleanedProfile = _.cloneDeep(profile); return Util.System.saveJSON(destPath, profile)
Util.Tree.walk(cleanedProfile, function(item) {
delete item.selected;
delete item._key;
});
return Util.System.saveJSON(destPath, cleanedProfile)
.then(function() { .then(function() {
dispatch({ type: SAVE_PROFILE_SUCCESS, profile: profile, path: destPath }); dispatch({ type: SAVE_PROFILE_SUCCESS, profile: profile, path: destPath });
logger.info('Profile saved.'); logger.info('Profile saved.');
}) })
.catch(function(err) { .catch(function(err) {
logger.error(err);
dispatch({ type: SAVE_PROFILE_FAILED, error: err }); dispatch({ type: SAVE_PROFILE_FAILED, error: err });
}) })
; ;