Skip to content

Commit 7f2fb9b

Browse files
Update show-marketplace-last-modified.js
Code fussing. Replaced placeholder text with nonbreaking whitespace, and flipped if-not-return.
1 parent d1a74de commit 7f2fb9b

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

show-marketplace-last-modified.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,18 @@
1414

1515
(() => {
1616
// Create placeholder so content doesn't jump around as noticably
17-
const lastModifiedElement = createLastModifiedElement('Date: checking...');
17+
const lastModifiedElement = createLastModifiedElement(" ");
1818
const productDescription = getProductDescription();
1919
productDescription.prepend(lastModifiedElement);
2020

2121
const url_main = getMainProductImageUrl();
2222
const url_thumbs = getOtherProductImageUrls();
2323

24-
const oldestUrlDate = promiseOldestUrlDate([url_main, ...url_thumbs]);
25-
26-
oldestUrlDate.then(date => {
27-
if (!date) return;
28-
29-
const fuzzy = getFuzzyDateFormat(date);
30-
lastModifiedElement.firstChild.innerHTML = `Date: ${fuzzy}`;
24+
promiseOldestUrlDate([url_main, ...url_thumbs]).then(date => {
25+
if (date) {
26+
const fuzzy = getFuzzyDateFormat(date);
27+
lastModifiedElement.firstChild.innerHTML = `Date: ${fuzzy}`;
28+
}
3129
});
3230
})();
3331

0 commit comments

Comments
 (0)