Skip to content

Commit 79fe1c3

Browse files
erkamyamanpkozlowski-opensource
authored andcommitted
fix(docs-infra): only claim a search on the 404 page when results exist
The "Page Not Found" page always rendered the sentence "We have initiated a search for the term extracted from the URL", but the NotFound component only runs a search when a term can be extracted, and only renders results when there is at least one hit. On a 404 with no extractable term or no matching results, the page asserted a search it never backed up. Gate the sentence behind the same searchResults() check that guards the results list, so the empty state simply reads "We couldn't find what you were looking for."
1 parent b8a0fa0 commit 79fe1c3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎adev/src/app/features/not-found/not-found.html‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
<div class="docs-not-found__bubble">
55
<h1 tabindex="-1">Page Not Found</h1>
66
<p>
7-
We couldn't find what you were looking for. We have initiated a search for the term
8-
extracted from the URL.
7+
We couldn't find what you were looking for.
8+
@if (searchResults().length > 0) {
9+
We have initiated a search for the term extracted from the URL.
10+
}
911
</p>
1012
<p>
1113
If you think this is a mistake, please

0 commit comments

Comments
 (0)