Skip to content

Commit

Permalink
feat: filter out mentions of recipient from replies
Browse files Browse the repository at this point in the history
  • Loading branch information
6lr61 committed Sep 18, 2024
1 parent cba9780 commit 54e5175
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@ export default function Message({ message }: Props): React.ReactElement {
</header>
{message.reply && <Reply message={message.reply} />}
<section className="h-full bg-slate-800 break-words px-2 py-1">
{fragments.map((fragment, index) =>
fragmentToComponent(fragment, index)
)}
{fragments
.filter((fragment) =>
message.reply && fragment.type === "mention"
? fragment.mention.user_id !== message.reply.parent_user_id
: true
)
.map((fragment, index) => fragmentToComponent(fragment, index))}
</section>
</section>
</article>
Expand Down

0 comments on commit 54e5175

Please sign in to comment.