Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/features/discover/model/discover.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ export function getPopularTags(profiles: Profile[]): { topTags: string[]; allTag

profiles.forEach((profile) => {
profile.canvas?.loves?.forEach((tag) => {
counts[tag] = (counts[tag] || 0) + 1;
const normalizedTag = tag.toLowerCase();
counts[normalizedTag] = (counts[normalizedTag] || 0) + 1;
});
profile.canvas?.comfort?.forEach((tag) => {
counts[tag] = (counts[tag] || 0) + 1;
const normalizedTag = tag.toLowerCase();
counts[normalizedTag] = (counts[normalizedTag] || 0) + 1;
});
});

Expand Down Expand Up @@ -56,8 +58,8 @@ export function filterProfiles(

const matchesTag =
!filters.selectedTag ||
profile.canvas?.loves?.includes(filters.selectedTag) ||
profile.canvas?.comfort?.includes(filters.selectedTag);
profile.canvas?.loves?.some((tag) => tag.toLowerCase() === filters.selectedTag.toLowerCase()) ||
profile.canvas?.comfort?.some((tag) => tag.toLowerCase() === filters.selectedTag.toLowerCase());

return Boolean(matchesSearch && matchesRole && matchesStatus && matchesTag);
});
Expand Down
Loading