feat: Implement custom emojis, pinned comments, and comment locking with database schema changes and frontend rendering updates.

This commit is contained in:
2026-01-25 23:01:31 +01:00
parent 1b8a9185bb
commit 286791de0d

View File

@@ -53,9 +53,8 @@ class CommentSystem {
// If comments are already rendered, we might need to re-render them to show emojis // If comments are already rendered, we might need to re-render them to show emojis
// but usually loadComments also happens async. // but usually loadComments also happens async.
// To be safe, if we just got emojis, trigger a silent update if container exists // To be safe, if we just got emojis, trigger a silent update if container exists
if (this.container && this.container.querySelector('.comment-content')) { if (this.container && this.lastData) {
// This is a bit heavy, but ensures emojis appear if they loaded AFTER comments this.render(this.lastData, this.lastUserId, this.lastIsSubscribed);
// For now let's just let it be.
} }
} else { } else {
this.customEmojis = {}; this.customEmojis = {};
@@ -188,6 +187,11 @@ class CommentSystem {
} }
render(comments, currentUserId, isSubscribed) { 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 // Build two-level tree: top-level comments + all replies at one level
const map = new Map(); const map = new Map();
const roots = []; const roots = [];