Nutrient Web SDK
    Preparing search index...

    Interface CommentsMentionEvent

    This event is emitted when the list of users mentioned in a comment changes or a new comment is created with mentions. The modifications property contains a list of modifications that were applied to the comment. Each modification contains the user ID and the action that was performed.

    The event is only emitted for the user that created or updated the comment either via the UI or the API. If you want to listen for changes to comments made by other users, you can use the comments.create, comments.change and comments.delete event. You get the affected comment in the event payload and can check the mentioned users using Comment.getMentionedUserIds method.

    Listen for changes to the changes in the list of mentioned users in a comment

    instance.addEventListener("comments.mention", (event) => {
    const { comment, modifications } = event;
    modifications.forEach((modification) => {
    const { userId, action } = modification;
    if (action === "ADDED") {
    console.log(`User ${userId} was mentioned in comment ${comment.id}`);
    } else {
    console.log(`User ${userId} was unmentioned in comment ${comment.id}`);
    }
    });
    });
    interface CommentsMentionEvent {
        comment: NutrientViewer.Comment;
        modifications: NutrientViewer.Immutable.List<
            { action: "ADDED"
            | "REMOVED"; userId: string },
        >;
    }
    Index

    Properties

    The comment that was updated.

    modifications: NutrientViewer.Immutable.List<
        { action: "ADDED"
        | "REMOVED"; userId: string },
    >

    A list of modifications that were applied to the comment.