store installDate and updateDate

This commit is contained in:
tophf 2017-11-26 20:47:23 +03:00
parent 4fd25f9e1a
commit ff175d9af4
2 changed files with 2 additions and 1 deletions

View File

@ -424,7 +424,7 @@ function saveStyle(style) {
return style; return style;
} }
codeIsUpdated = !existed || 'sections' in style && !styleSectionsEqual(style, oldStyle); codeIsUpdated = !existed || 'sections' in style && !styleSectionsEqual(style, oldStyle);
style = Object.assign({}, oldStyle, style); style = Object.assign({installDate: Date.now()}, oldStyle, style);
return write(style, store); return write(style, store);
}); });
} else { } else {

View File

@ -127,6 +127,7 @@ var updater = {
function maybeSave(json) { function maybeSave(json) {
json.id = style.id; json.id = style.id;
json.updateDate = Date.now();
if (styleSectionsEqual(json, style)) { if (styleSectionsEqual(json, style)) {
// JSONs may have different order of items even if sections are effectively equal // JSONs may have different order of items even if sections are effectively equal
// so we'll update the digest anyway // so we'll update the digest anyway