Fix search count

This commit is contained in:
RubenPX 2022-04-12 13:59:25 +02:00
parent b8493d8f5c
commit c733f0a1d8

View file

@ -280,15 +280,15 @@
let resultCount = 0; let resultCount = 0;
function searchCompleted() { function searchCompleted() {
resultCount++; resultCount++;
if (resultCount < 2 && document.getElementById("dropdown-search-list").children.length > 0) {
setTimeout(() => { setTimeout(() => {
if (resultCount == 2 && document.getElementById("dropdown-search-list").children.length == 2) {
document.getElementById("dropdown-search-list").innerHTML = ` document.getElementById("dropdown-search-list").innerHTML = `
<li id="deviceSearchLoader" class="dropdown-item"> <li id="deviceSearchLoader" class="dropdown-item">
<i class="bi bi-x-lg"></i> <i class="bi bi-x-lg"></i>
<span style="margin-right: 10px">Nothing found</span> <span style="margin-right: 10px">Nothing found</span>
</li>` </li>`
}, 100)
} }
}, 100)
} }
timeoutHandler = setTimeout(async () => { timeoutHandler = setTimeout(async () => {