From b4fc433e22ec7192ac5dbe43aa6f483574ac1726 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Sun, 13 Feb 2022 14:12:53 +0100 Subject: Fix duck pond not showing for search results of 0. --- pydis_site/static/js/resources/resources.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'pydis_site/static/js') diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js index bbf07c94..b74c28ec 100644 --- a/pydis_site/static/js/resources/resources.js +++ b/pydis_site/static/js/resources/resources.js @@ -220,7 +220,6 @@ function updateUI() { } // Otherwise, hide everything and then filter the resources to decide what to show. - let hasMatches = false; resources.hide(); let filteredResources = resources.filter(function() { let validation = { @@ -249,7 +248,6 @@ function updateUI() { // If validation passes, show the resource. if (Object.values(validation).every(Boolean)) { - hasMatches = true; return true; } else { return false; @@ -265,7 +263,8 @@ function updateUI() { } // If there are no matches, show the no matches message - if (!hasMatches) { + let visibleResources = Boolean($(".resource-box:visible").length); + if (!visibleResources) { $(".no-resources-found").show(); } else { $(".no-resources-found").hide(); -- cgit v1.2.3