Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🙉 Do not notify of own posts in own threads #4746

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

thesan
Copy link
Member

@thesan thesan commented Jan 26, 2024

No description provided.

Copy link

vercel bot commented Jan 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
dao ✅ Ready (Inspect) Visit Preview Jan 29, 2024 8:15am
pioneer-2 ✅ Ready (Inspect) Visit Preview Jan 29, 2024 8:15am
pioneer-2-storybook ✅ Ready (Inspect) Visit Preview Jan 29, 2024 8:15am

Copy link
Member

@kdembler kdembler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small nitpicks, otherwise LGTM


const mentionedMemberIds = difference(getMentionedMemberIds(post.text), [authorId])
const repliedToMemberIds = difference([Number(post.repliesTo?.authorId)], [NaN, authorId])
const mentionedMemberIds = difference(getMentionedMemberIds(post.text))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

difference call not needed anymore

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

generalEvent('FORUM_POST_MENTION', mentionedMemberIds),
generalEvent('FORUM_POST_REPLY', repliedToMemberIds),
generalEvent('FORUM_THREAD_CREATOR', [Number(post.thread.authorId)]),
generalEvent('FORUM_POST_REPLY', repliedToMemberId ?? []),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe safer to do || [] in case repliedToMemberId is somehow NaN?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repliedToMemberId is [number] | null | undefined so ?? should be good here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants