Hide empty folders in embeddings search results (#1506)

This commit is contained in:
JeLuF 2023-08-17 09:53:13 +02:00 committed by GitHub
parent 07f797a5e4
commit d632cfcde9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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('<br style="clear: both;">'), folders)
return result