Fix: remove codeIsUpdated in styleman

This commit is contained in:
eight04 2021-12-07 12:36:59 +08:00
parent cc314b7be0
commit e820f5de4a

View File

@ -283,7 +283,7 @@ const styleMan = (() => {
async toggle(id, enabled) {
if (ready.then) await ready;
const style = Object.assign({}, id2style(id), {enabled});
await saveStyle(style, {reason: 'toggle', codeIsUpdated: false});
await saveStyle(style, {reason: 'toggle'});
return id;
},
@ -302,7 +302,7 @@ const styleMan = (() => {
if (ready.then) await ready;
const style = Object.assign({}, id2style(id));
style[prop] = value;
return saveStyle(style, {reason: 'config', codeIsUpdated: false});
return saveStyle(style, {reason: 'config'});
},
};
@ -396,7 +396,7 @@ const styleMan = (() => {
return saveStyle(style, {reason: 'config'});
}
function broadcastStyleUpdated(style, reason, method = 'styleUpdated', codeIsUpdated = true) {
function broadcastStyleUpdated(style, reason, method = 'styleUpdated') {
const {id} = style;
const data = id2data(id);
const excluded = new Set();
@ -419,7 +419,6 @@ const styleMan = (() => {
return msg.broadcast({
method,
reason,
codeIsUpdated,
style: {
id,
md5Url: style.md5Url,
@ -459,7 +458,7 @@ const styleMan = (() => {
return handleSave(style, handlingOptions);
}
function handleSave(style, {reason, codeIsUpdated, broadcast = true}) {
function handleSave(style, {reason, broadcast = true}) {
const data = id2data(style.id);
const method = data ? 'styleUpdated' : 'styleAdded';
if (!data) {
@ -467,7 +466,7 @@ const styleMan = (() => {
} else {
data.style = style;
}
if (broadcast) broadcastStyleUpdated(style, reason, method, codeIsUpdated);
if (broadcast) broadcastStyleUpdated(style, reason, method);
return style;
}