Empty search error displayed
This commit is contained in:
parent
dfc068abf3
commit
42e78ca977
1 changed files with 1 additions and 2 deletions
|
|
@ -95,7 +95,6 @@ function searchSongsEnter(e) {
|
||||||
|
|
||||||
async function searchSongs(searchTerm){
|
async function searchSongs(searchTerm){
|
||||||
let optionslist = []
|
let optionslist = []
|
||||||
|
|
||||||
document.getElementById("songlist").innerHTML = ""
|
document.getElementById("songlist").innerHTML = ""
|
||||||
searchResults = await getFromServer({search:searchTerm},"search").then()
|
searchResults = await getFromServer({search:searchTerm},"search").then()
|
||||||
//generate the visual song list
|
//generate the visual song list
|
||||||
|
|
@ -124,7 +123,7 @@ async function searchSongs(searchTerm){
|
||||||
document.getElementById("songlist").appendChild(newItem);
|
document.getElementById("songlist").appendChild(newItem);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (searchResults.length == 0) {
|
if (JSON.stringify(searchResults)==JSON.stringify({})) {
|
||||||
//display error if no results
|
//display error if no results
|
||||||
document.getElementById("songlist").innerHTML = "<h1>We might not have that one...</h1>";
|
document.getElementById("songlist").innerHTML = "<h1>We might not have that one...</h1>";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue