Revert: isSame/isEdited util

This commit is contained in:
eight 2017-11-09 12:31:40 +08:00
parent 4a8894de2e
commit 1dd0dbf907
2 changed files with 6 additions and 10 deletions

View File

@ -23,14 +23,6 @@ var updater = {
lastUpdateTime: parseInt(localStorage.lastUpdateTime) || Date.now(),
isSame(code) {
return code === updater.SAME_MD5 || code === updater.SAME_CODE || code === updater.SAME_VERSION;
},
isEdited(code) {
return code === updater.EDITED || code === updater.MAYBE_EDITED;
},
checkAllStyles({observer = () => {}, save = true, ignoreDigest} = {}) {
updater.resetInterval();
updater.checkAllStyles.running = true;

View File

@ -114,8 +114,12 @@ function reportUpdateState(state, style, details) {
if (entry.classList.contains('can-update')) {
break;
}
const same = BG.updater.isSame(details);
const edited = BG.updater.isEdited(details);
const same = (
details === BG.updater.SAME_MD5 ||
details === BG.updater.SAME_CODE ||
details === BG.updater.SAME_VERSION
);
const edited = details === BG.updater.EDITED || details === BG.updater.MAYBE_EDITED;
entry.dataset.details = details;
if (!details) {
details = t('updateCheckFailServerUnreachable');