Skip to content

Commit

Permalink
refactor: just drop the first fragment in replies
Browse files Browse the repository at this point in the history
  • Loading branch information
6lr61 committed Sep 18, 2024
1 parent 54e5175 commit 0f3f465
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/components/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ export default function Message({ message }: Props): React.ReactElement {
{message.reply && <Reply message={message.reply} />}
<section className="h-full bg-slate-800 break-words px-2 py-1">
{fragments
.filter((fragment) =>
message.reply && fragment.type === "mention"
? fragment.mention.user_id !== message.reply.parent_user_id
: true
)
.slice(message.reply ? 1 : 0) // Drop the first mention fragment
.map((fragment, index) => fragmentToComponent(fragment, index))}
</section>
</section>
Expand Down

0 comments on commit 0f3f465

Please sign in to comment.