Skip to content

Commit

Permalink
Update article-list.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kailasnadh790 committed Jan 25, 2024
1 parent 148d0d1 commit ef6aa81
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cigaradvisor/blocks/article-list/article-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ async function renderByAuthor(wrapper, author) {
async function renderByList(configs, wrapper, pinnedArticles) {
// eslint-disable-next-line no-param-reassign
pinnedArticles = Array.isArray(pinnedArticles) ? pinnedArticles : [pinnedArticles];
const extra = [];
if (configs.next && !Number.isNaN(parseInt(configs.next, 10))) {
let extra = [];
if (configs.next && configs.next.toLowerCase() === 'all') {
extra = [...(await loadPosts())];
} else if (configs.next && !Number.isNaN(parseInt(configs.next, 10))) {
const total = parseInt(configs.next, 10);
let i = 0; // Counter for how many we've found
let idx = 1; // Counter for moving through the post list.
Expand Down Expand Up @@ -125,7 +127,7 @@ export default async function decorate(block) {
await renderByCategory(articleTeaserWrapper, category);
} else if (author) {
await renderByAuthor(articleTeaserWrapper, author);
} else if (articles) {
} else {
await renderByList(configs, articleTeaserWrapper, articles);
}

Expand All @@ -134,7 +136,7 @@ export default async function decorate(block) {
await renderByCategory(articleTeaserWrapper, category);
} else if (author) {
await renderByAuthor(articleTeaserWrapper, author);
} else if (articles) {
} else {
await renderByList(configs, articleTeaserWrapper, articles);
}
});
Expand Down

0 comments on commit ef6aa81

Please sign in to comment.