Fix: save name when updating usercss

This commit is contained in:
eight 2017-09-18 12:59:22 +08:00
parent 94a7e0cdb5
commit aa71984fd3

View File

@ -139,14 +139,16 @@ var updater = {
}
function maybeSave(json) {
const doSave = json.usercssData ? usercssHelper.save : saveStyle;
json.id = style.id;
// no need to compare section code for usercss, they are built dynamically
return !save ? json :
doSave(Object.assign(json, {
name: null, // keep local name customizations
reason: 'update',
}));
if (!save) {
return json;
}
json.reason = 'update';
if (json.usercssData) {
return usercssHelper.save(json);
}
json.name = null; // keep local name customizations
return saveStyle(json);
}
function styleJSONseemsValid(json) {