diff options
Diffstat (limited to 'html/repo_query.js')
-rw-r--r-- | html/repo_query.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/html/repo_query.js b/html/repo_query.js index 8f33356..a4b8890 100644 --- a/html/repo_query.js +++ b/html/repo_query.js @@ -118,16 +118,17 @@ function RepoEntry(query_view, repo_url) { return; } - this.info_span.remove(); - this.results_list.classList.remove("hide"); - this.result_entries = results.map(ref => new ResultEntry(this, ref)); - const to_append = this.result_entries.length > 0 ? - this.result_entries.map(re => re.main_li) : - ["No results :("]; + if (this.result_entries.length > 0) { + this.results_list.classList.remove("hide"); + this.info_span.remove(); - this.results_list.append(...to_append); + const to_append = this.result_entries.map(re => re.main_li); + this.results_list.append(...to_append); + } else { + this.info_span.innerText = "No results :("; + } } let show_results = () => { |