Skip to content

Commit f17c1ba

Browse files
MitchC1999Farzad Hayat
andauthored
Apply suggestions from code review
Co-authored-by: Farzad Hayat <[email protected]>
1 parent e2a4425 commit f17c1ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/ROOT/partials/plugin-apis/comments-apis.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,12 @@ console.log(comments.getEventLog(
131131
132132
const eventLog = comments.getEventLog();
133133
const events = eventLog.events;
134-
const mentionedUsers = events.flatMap(({ mentionedUids }) => mentionedUids);
134+
const mentionedUsers = events.flatMap(({ mentionedUids }) => mentionedUids || []);
135+
console.log(mentionedUsers);
135136
136137
let whoMentionedWho = {};
137138
events.forEach((event) => {
138-
if (event.type === "create" || event.type === "reply") {
139+
if ((event.type === "create" || event.type === "reply") && event.mentionedUids !== undefined) {
139140
console.log(event);
140141
if (whoMentionedWho[event.conversationAuthor.author] === undefined) {
141142
whoMentionedWho[event.conversationAuthor.author] = event.mentionedUids;

0 commit comments

Comments
 (0)