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) { function maybeSave(json) {
const doSave = json.usercssData ? usercssHelper.save : saveStyle;
json.id = style.id; json.id = style.id;
// no need to compare section code for usercss, they are built dynamically if (!save) {
return !save ? json : return json;
doSave(Object.assign(json, { }
name: null, // keep local name customizations json.reason = 'update';
reason: 'update', if (json.usercssData) {
})); return usercssHelper.save(json);
}
json.name = null; // keep local name customizations
return saveStyle(json);
} }
function styleJSONseemsValid(json) { function styleJSONseemsValid(json) {