From 286791de0dfde2504765ab92f1ee73fb6434a5c3 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Sun, 25 Jan 2026 23:01:31 +0100 Subject: [PATCH] feat: Implement custom emojis, pinned comments, and comment locking with database schema changes and frontend rendering updates. --- public/s/js/comments.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/s/js/comments.js b/public/s/js/comments.js index e8f34d5..bdfd719 100644 --- a/public/s/js/comments.js +++ b/public/s/js/comments.js @@ -53,9 +53,8 @@ class CommentSystem { // If comments are already rendered, we might need to re-render them to show emojis // but usually loadComments also happens async. // To be safe, if we just got emojis, trigger a silent update if container exists - if (this.container && this.container.querySelector('.comment-content')) { - // This is a bit heavy, but ensures emojis appear if they loaded AFTER comments - // For now let's just let it be. + if (this.container && this.lastData) { + this.render(this.lastData, this.lastUserId, this.lastIsSubscribed); } } else { this.customEmojis = {}; @@ -188,6 +187,11 @@ class CommentSystem { } render(comments, currentUserId, isSubscribed) { + // Store for re-rendering when emojis load + this.lastData = comments; + this.lastUserId = currentUserId; + this.lastIsSubscribed = isSubscribed; + // Build two-level tree: top-level comments + all replies at one level const map = new Map(); const roots = [];