Skip to content

Commit 9bcb1fa

Browse files
authored
[WEB-5515]: comments ordering (#8193)
* fix: comments ordering * fix: comment timestamp:
1 parent c31a225 commit 9bcb1fa

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

apps/web/ce/components/comments/comment-block.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const CommentBlock = observer(function CommentBlock(props: TCommentBlock)
6464
position="bottom"
6565
>
6666
<span className="text-custom-text-350">
67-
{calculateTimeAgo(comment.updated_at)}
67+
{calculateTimeAgo(comment.created_at)}
6868
{comment.edited_at && ` (${t("edited")})`}
6969
</span>
7070
</Tooltip>

apps/web/ce/store/issue/issue-details/activity.store.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,10 @@ export class IssueActivityStore implements IIssueActivityStore {
112112
comments.forEach((commentId) => {
113113
const comment = currentStore.comment.getCommentById(commentId);
114114
if (!comment) return;
115-
const commentTimestamp = comment.edited_at ?? comment.updated_at ?? comment.created_at;
116115
activityComments.push({
117116
id: comment.id,
118117
activity_type: EActivityFilterType.COMMENT,
119-
created_at: commentTimestamp,
118+
created_at: comment.created_at,
120119
});
121120
});
122121

apps/web/core/components/issues/issue-detail/issue-activity/activity-comment-root.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { FC } from "react";
21
import { observer } from "mobx-react";
32
// plane imports
43
import type { E_SORT_ORDER, TActivityFilters } from "@plane/constants";
@@ -78,16 +77,19 @@ export const IssueActivityCommentRoot = observer(function IssueActivityCommentRo
7877
/>
7978
) : BASE_ACTIVITY_FILTER_TYPES.includes(activityComment.activity_type as EActivityFilterType) ? (
8079
<IssueActivityItem
80+
key={activityComment.id}
8181
activityId={activityComment.id}
8282
ends={index === 0 ? "top" : index === filteredActivityAndComments.length - 1 ? "bottom" : undefined}
8383
/>
8484
) : activityComment.activity_type === "ISSUE_ADDITIONAL_PROPERTIES_ACTIVITY" ? (
8585
<IssueAdditionalPropertiesActivity
86+
key={activityComment.id}
8687
activityId={activityComment.id}
8788
ends={index === 0 ? "top" : index === filteredActivityAndComments.length - 1 ? "bottom" : undefined}
8889
/>
8990
) : activityComment.activity_type === "WORKLOG" ? (
9091
<IssueActivityWorklog
92+
key={activityComment.id}
9193
workspaceSlug={workspaceSlug}
9294
projectId={projectId}
9395
issueId={issueId}

0 commit comments

Comments
 (0)