Correction sauvegarde de profil modifié via éditeur, fixes #2
This commit is contained in:
parent
4d2891f9b6
commit
a47635c675
|
@ -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 });
|
||||||
})
|
})
|
||||||
;
|
;
|
||||||
|
|
Loading…
Reference in New Issue