fix: Duplicate threads in sidebar when comment mark crosses boundary

This commit is contained in:
Tom Moor
2024-10-24 09:45:20 -04:00
parent 4f626c08c2
commit 48ff0ad84b
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ import compact from "lodash/compact";
import differenceBy from "lodash/differenceBy";
import keyBy from "lodash/keyBy";
import orderBy from "lodash/orderBy";
import uniq from "lodash/uniq";
import { action, computed } from "mobx";
import Comment from "~/models/Comment";
import { CommentSortOption, CommentSortType } from "~/types";
@@ -50,7 +51,7 @@ export default class CommentsStore extends Store<Comment> {
const commentsById = keyBy(comments, "id");
const referencedComments = compact(
options.referencedCommentIds.map((id) => commentsById[id])
uniq(options.referencedCommentIds.map((id) => commentsById[id]))
);
const directComments = differenceBy(comments, referencedComments, "id");
+2 -2
View File
@@ -217,8 +217,8 @@ export type Properties<C> = {
};
export enum CommentSortType {
MostRecent = "most_recent",
OrderInDocument = "order_in_document",
MostRecent = "mostRecent",
OrderInDocument = "orderInDocument",
}
export type CommentSortOption =