Skip to content

Commit

Permalink
fix(search): single if
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoSerranoP committed Dec 17, 2024
1 parent 73553c4 commit 48e80f0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/interface/src/utils/fetchProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,9 @@ export async function fetchApprovedProjectsWithMetadata(
const recipients = await Promise.all(
response.map(async (request) => {
const metadata = (await fetchMetadata(request.metadataUrl)) as unknown as Application;
if (search !== "") {
const name = metadata.name.toLowerCase();
if (!name.includes(search.trim().toLowerCase())) {
return null;
}
const name = metadata.name.toLowerCase();
if (search !== "" && !name.includes(search.trim().toLowerCase())) {
return null;
}
return {
id: request.id,
Expand Down

0 comments on commit 48e80f0

Please sign in to comment.