From e8c7a9b0e2b4a31c408e55887cdec66fd8b70923 Mon Sep 17 00:00:00 2001 From: Pat Date: Wed, 14 Aug 2024 09:08:46 -0600 Subject: [PATCH] Filters out excluded articles correctly --- js/ucb-article-list.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/ucb-article-list.js b/js/ucb-article-list.js index 478f7632..2406055f 100644 --- a/js/ucb-article-list.js +++ b/js/ucb-article-list.js @@ -212,7 +212,9 @@ let results = await Promise.all(promises); - results.forEach(result => { + results + .filter(result => result !== undefined) + .forEach(result => { let dataOutput = document.getElementById("ucb-al-data"); let thisArticle = document.createElement("article"); thisArticle.className = 'ucb-article-card-container'; @@ -220,6 +222,7 @@ dataOutput.append(thisArticle); }); + if (NEXTJSONURL) { toggleMessage('ucb-el-load-more', 'inline-block'); }