fix: handle empty commenter name in mention notification emails (#400)
Use `||` instead of `??` so empty strings also fall back to email. The nullish coalescing operator (`??`) only catches null/undefined, so users with an empty name string would appear nameless in emails.
This commit is contained in:
@@ -53,7 +53,7 @@ export async function sendMentionEmails({
|
||||
const commenter = await userRepo.getById(db, commenterUserId);
|
||||
if (!commenter) return;
|
||||
|
||||
const commenterName = commenter.name ?? commenter.email;
|
||||
const commenterName = commenter.name?.trim() || commenter.email;
|
||||
|
||||
// Get mentioned members with full details (filtered by workspace)
|
||||
const membersWithDetails = await memberRepo.getByPublicIdsWithUsers(
|
||||
|
||||
Reference in New Issue
Block a user