feat: Implement custom emojis, pinned comments, and comment locking with database schema changes and frontend rendering updates.
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user