Activities: Category badge shows non-category hashtags (e.g. "OrangePillApp") #21
Labels
No labels
app:activities
app:chat
app:events
app:forum
app:libra
app:market
app:restaurant
app:tasks
app:wallet
app:webapp
bug
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aiolabs/webapp#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
ActivityCard shows the first hashtag (
ttag) as a category badge, but many NIP-52 events use hashtags that aren't one of our 25 defined categories (e.g. "OrangePillApp", "bitcoin", brand names).Expected behavior
Only show the category badge if the hashtag matches a known
ActivityCategoryfromsrc/modules/activities/types/category.ts.Fix
In
src/modules/activities/types/activity.ts, thecalendarTimeEventToActivityandcalendarDateEventToActivityfunctions blindly assignevent.hashtags[0]as the category:Should instead check against
ALL_CATEGORIES:Files
src/modules/activities/types/activity.ts—calendarTimeEventToActivity(),calendarDateEventToActivity()src/modules/activities/types/category.ts—ALL_CATEGORIES