mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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."
This commit is contained in:
@@ -4,8 +4,10 @@
|
||||
<div class="docs-not-found__bubble">
|
||||
<h1 tabindex="-1">Page Not Found</h1>
|
||||
<p>
|
||||
We couldn't find what you were looking for. We have initiated a search for the term
|
||||
extracted from the URL.
|
||||
We couldn't find what you were looking for.
|
||||
@if (searchResults().length > 0) {
|
||||
We have initiated a search for the term extracted from the URL.
|
||||
}
|
||||
</p>
|
||||
<p>
|
||||
If you think this is a mistake, please
|
||||
|
||||
Reference in New Issue
Block a user