Skip to content

Commit

Permalink
Merge pull request #594 from hlxsites/fix-590
Browse files Browse the repository at this point in the history
fix: fix empty result handling
  • Loading branch information
davenichols-DHLS authored Dec 14, 2023
2 parents bbf9cc4 + 07f35a7 commit bf52052
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions blocks/category-family/category-family.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ export default async function decorate(block) {

engine.subscribe(() => {
const totalCount = engine?.state?.search?.response?.totalCount;
if (totalCount !== undefined && totalCount === 0
&& document.querySelector('div.category-family-container') !== null) {
document.querySelector('div.category-family-container').remove();
if (totalCount !== undefined && totalCount === 0) {
block.remove();
}
});
}

0 comments on commit bf52052

Please sign in to comment.