fix(mods): fix sorting not working without tag selected

This commit is contained in:
taroj1205 2024-11-03 14:28:43 +13:00
parent 0c2ce6527f
commit 9acbb7860b

View file

@ -135,11 +135,7 @@ export function getThemesFromSearch(
): ZenTheme[] { ): ZenTheme[] {
const normalizedQuery = query.toLowerCase(); const normalizedQuery = query.toLowerCase();
// If there's no query and no tags, return all themes (or handle no results case explicitly) // Filter themes based on query, tags, and date
if (!normalizedQuery && tags.length === 0) {
return themes; // Or return an empty array [] if you want no results by default
}
const filteredThemes = themes.filter((theme) => { const filteredThemes = themes.filter((theme) => {
const matchesQuery = theme.name.toLowerCase().includes(normalizedQuery); const matchesQuery = theme.name.toLowerCase().includes(normalizedQuery);
const matchesTag = const matchesTag =