mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
fix: Duplicate threads in sidebar when comment mark crosses boundary
This commit is contained in:
@@ -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
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user