From d632cfcde92493abe304705a2fccbd2cf4c574b7 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Thu, 17 Aug 2023 09:53:13 +0200 Subject: [PATCH] Hide empty folders in embeddings search results (#1506) --- ui/media/js/main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 4abacdfc..6db36ee8 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -2762,6 +2762,12 @@ function updateEmbeddingsList(filter = "") { } } }) + + if (toplevel.children.length == 0 && folders.children.length == 0) { + // Empty folder + return "" + } + let result = document.createElement("div") result.replaceChildren(toplevel, htmlToElement('
'), folders) return result