From 42e78ca9777bf77fe5696af01ca90e9bf80bfb4c Mon Sep 17 00:00:00 2001 From: Kristy Fournier <124598538+kristy-fournier@users.noreply.github.com> Date: Thu, 6 Mar 2025 10:14:17 -0500 Subject: [PATCH] Empty search error displayed --- Client/scripts.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Client/scripts.js b/Client/scripts.js index fe09161..2aa73c7 100644 --- a/Client/scripts.js +++ b/Client/scripts.js @@ -95,7 +95,6 @@ function searchSongsEnter(e) { async function searchSongs(searchTerm){ let optionslist = [] - document.getElementById("songlist").innerHTML = "" searchResults = await getFromServer({search:searchTerm},"search").then() //generate the visual song list @@ -124,7 +123,7 @@ async function searchSongs(searchTerm){ document.getElementById("songlist").appendChild(newItem); } - if (searchResults.length == 0) { + if (JSON.stringify(searchResults)==JSON.stringify({})) { //display error if no results document.getElementById("songlist").innerHTML = "