Skip to content

Commit

Permalink
fix: solve issue with excluded_status (#8692vx9qe)
Browse files Browse the repository at this point in the history
  • Loading branch information
dziudek committed Oct 7, 2023
1 parent e10fbfc commit 37d9b12
Showing 1 changed file with 9 additions and 4 deletions.
Expand Up @@ -138,12 +138,17 @@ function getPostsByTagsHelper (rendererInstance, Handlebars) {

if (allowedStatus !== 'any') {
allowedStatus = allowedStatus.split(',');
excludedStatus = excludedStatus.split(',');

if (excludedStatus !== '') {
excludedStatus = excludedStatus.split(',');
}

filteredPosts = filteredPosts.filter(post => {
for (let i = 0; i < excludedStatus.length; i++) {
if (post.status.indexOf(excludedStatus[i]) > -1) {
return false;
if (excludedStatus) {
for (let i = 0; i < excludedStatus.length; i++) {
if (post.status.indexOf(excludedStatus[i]) > -1) {
return false;
}
}
}

Expand Down

0 comments on commit 37d9b12

Please sign in to comment.