Feat: search description and title when searching for mods (#297)

This commit is contained in:
Heinrich-XIAO 2024-11-19 19:02:15 -05:00 committed by GitHub
parent 3e300f3756
commit b90d5092a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -138,7 +138,9 @@ export function getThemesFromSearch(
// Filter themes based on query, tags, and date
const filteredThemes = themes.filter((theme) => {
const matchesQuery = theme.name.toLowerCase().includes(normalizedQuery);
const titleMatchesQuery = theme.name.toLowerCase().includes(normalizedQuery);
const descriptionMatchesQuery = theme.description.toLowerCase().includes(normalizedQuery);
const matchesQuery = titleMatchesQuery || descriptionMatchesQuery;
const matchesTag =
tags.length === 0 ||
(theme.tags && tags.some((tag) => theme.tags.includes(tag)));