Fix: manually updated usercss doesn't keep settings

This commit is contained in:
eight 2017-09-18 12:18:55 +08:00
parent 1d829fe8f5
commit 94a7e0cdb5

View File

@ -361,12 +361,19 @@ Object.assign(handleEvent, {
},
update(event, entry) {
// update everything but name
saveStyleSafe(Object.assign(entry.updatedCode, {
const request = Object.assign(entry.updatedCode, {
id: entry.styleId,
name: null,
reason: 'update',
}));
});
if (entry.updatedCode.usercssData) {
onBackgroundReady().then(() =>
BG.usercssHelper.save(request)
);
} else {
// update everything but name
request.name = null;
saveStyleSafe(request);
}
},
delete(event, entry) {