From 10047ba9f06758502759e70a2ddec4c54591cd8f Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Fri, 1 Dec 2023 23:33:39 +0000 Subject: [PATCH] Fix latest comment update issue on comment adding. --- public/js/module/comment/comments.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/public/js/module/comment/comments.js b/public/js/module/comment/comments.js index 975a61f8..b077a760 100644 --- a/public/js/module/comment/comments.js +++ b/public/js/module/comment/comments.js @@ -1248,14 +1248,12 @@ define([ comment.can.edit = true; comment.can.del = true; + self.commentsHash[comment.cid] = comment; + // New comment is the latest, remove previous latest comment highlight. comment.latest = true; - $('.badge-latest', self.$cmts).prev('.dotDelimeter').remove(); - $('.badge-latest', self.$cmts).remove(); $('.latest', self.$cmts).removeClass('latest'); - self.latestCommentStamp(comment.stamp); - - self.commentsHash[comment.cid] = comment; + self.latestCommentCid(comment.cid); const $c = $(tplCommentAuth(comment, { reply: self.canReply(),