fix some bugs associated with empty webring data initially

indiachan-spamvector
Thomas Lynch 3 years ago
parent 309a38abee
commit 5b182d32d7
  1. 7
      db/boards.js
  2. 4
      views/pages/home.pug

@ -298,7 +298,12 @@ module.exports = {
}
])
.toArray()
.then(res => res[0].sites.sort((a, b) => a.localeCompare(b)));
.then(res => {
if (res[0].sites) {
return res[0].sites.sort((a, b) => a.localeCompare(b));
}
return [];
});
cache.set('webringsites', webringSites);
}
return webringSites;

@ -51,13 +51,13 @@ block content
.table-container.flex-center.mv-10.text-center
table(style='max-width:450px')
tr
th Overall Stats
th Local Stats
tr
td
pre.no-m-p
| There are currently #[span.bold #{localStats.total-localStats.unlisted}] public boards, #[span.bold #{localStats.total}] in total. Sitewide, #[span.bold #{localStats.ppd}] post#{localStats.ppd === 1 ? ' has' : 's have'} been made in the last day, #[span.bold #{localStats.pph}] in the last hour, #[span.bold #{localStats.posts}] in total.
| #[span.bold #{fileStats.count}] file#{fileStats.count === 1 ? ' is' : 's are'} being served, totaling #[span.bold #{fileStats.totalSizeString}].
if enableWebring === true
if enableWebring === true && webringStats != null
.table-container.flex-center.mv-10.text-center
table(style='max-width:450px')
tr

Loading…
Cancel
Save