Load styles list in preferences even if custom style has an invalid date

A bundled style will get replaced from the repo if it has an invalid
date, but a custom style would result in an empty list.

https://forums.zotero.org/discussion/comment/399774/#Comment_399774
This commit is contained in:
Dan Stillman 2022-02-20 23:06:49 -05:00
parent 191e43dcfa
commit 9a2aec970d

View file

@ -91,9 +91,10 @@ Zotero_Preferences.Cite = {
await Zotero.Styles.init();
this.styles = Zotero.Styles.getVisible()
.map((style) => {
var updated = Zotero.Date.sqlToDate(style.updated, true);
return {
title: style.title,
updated: Zotero.Date.sqlToDate(style.updated, true).toLocaleDateString()
updated: updated ? updated.toLocaleDateString() : ""
};
});