mirror of
https://github.com/outline/outline.git
synced 2026-11-22 22:02:35 +03:00
fix: newMentionIds no longer always in event data, closes #7186
This commit is contained in:
1 parent
a8d4a5b587
commit
8a8dad15ef
2 files changed
+7
-2
No files matched your search
@@ -6,6 +6,11 @@ import BaseTask, { TaskPriority } from "./BaseTask";
|
||||
|
||||
export default class CommentUpdatedNotificationsTask extends BaseTask<CommentEvent> {
|
||||
public async perform(event: CommentUpdateEvent) {
|
||||
const newMentionIds = event.data.newMentionIds;
|
||||
if (!newMentionIds) {
|
||||
return;
|
||||
}
|
||||
|
||||
const [document, comment] = await Promise.all([
|
||||
Document.scope("withCollection").findOne({
|
||||
where: {
|
||||
@@ -20,7 +25,7 @@ export default class CommentUpdatedNotificationsTask extends BaseTask<CommentEve
|
||||
|
||||
const mentions = ProsemirrorHelper.parseMentions(
|
||||
ProsemirrorHelper.toProsemirror(comment.data)
|
||||
).filter((mention) => event.data.newMentionIds.includes(mention.id));
|
||||
).filter((mention) => newMentionIds.includes(mention.id));
|
||||
const userIdsMentioned: string[] = [];
|
||||
|
||||
for (const mention of mentions) {
|
||||
|
||||
+1
-1
@@ -342,7 +342,7 @@ export type CommentUpdateEvent = BaseEvent<Comment> & {
|
||||
documentId: string;
|
||||
actorId: string;
|
||||
data: {
|
||||
newMentionIds: string[];
|
||||
newMentionIds?: string[];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user