diff --git a/ghost/sodo-search/src/components/PopupModal.js b/ghost/sodo-search/src/components/PopupModal.js index 89cb4c9265..2a45600c48 100644 --- a/ghost/sodo-search/src/components/PopupModal.js +++ b/ghost/sodo-search/src/components/PopupModal.js @@ -148,8 +148,8 @@ function SearchClearIcon() { } function Loading() { - const {indexComplete} = useContext(AppContext); - if (!indexComplete) { + const {indexComplete, searchValue} = useContext(AppContext); + if (!indexComplete && searchValue) { return ( ); @@ -448,6 +448,16 @@ function SearchResultBox() { filteredTags = searchResults?.tags || []; } + filteredAuthors = filteredAuthors.filter((author) => { + const invalidUrlRegex = /\/404\/$/; + return !(author?.url && invalidUrlRegex.test(author?.url)); + }); + + filteredTags = filteredTags.filter((tag) => { + const invalidUrlRegex = /\/404\/$/; + return !(tag?.url && invalidUrlRegex.test(tag?.url)); + }); + const hasResults = filteredPosts?.length || filteredAuthors?.length || filteredTags?.length; if (hasResults) {