Skip to content
Snippets Groups Projects
Commit 548ca4c7 authored by Etienne LOUPIAS's avatar Etienne LOUPIAS
Browse files

fix no headline

parent cd3034cc
No related branches found
No related tags found
2 merge requests!244Dev,!243feat/US17-posts-pagination
......@@ -66,8 +66,10 @@ export class PostListComponent implements OnInit {
post.tags.some((tag) => tag && tag.slug === TagEnum.aLaUne)
);
const headIndex = this.allPosts.findIndex((post) => post.id === headLineTag[0].id);
this.allPosts.splice(headIndex, 1);
if (headLineTag.length) {
const headIndex = this.allPosts.findIndex((post) => post.id === headLineTag[0].id);
this.allPosts.splice(headIndex, 1);
}
this.allPosts = [...headLineTag, ..._.difference(this.allPosts, headLineTag)];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment