Fixed empty search result causing UI crash

This commit is contained in:
Rishabh 2022-07-05 17:37:40 +02:00
parent df03c47ac1
commit c429b90c11

View File

@ -290,14 +290,14 @@ function SearchResultBox() {
if (indexComplete && searchValue) {
searchResults = searchIndex.search(searchValue);
console.log(searchResults);
filteredPosts = searchResults.map((d) => {
filteredPosts = searchResults?.map((d) => {
return {
id: d?.id,
excerpt: d?.excerpt,
title: d?.title,
slug: d?.slug
};
});
}) || [];
console.log(filteredPosts);
}