feat: Introduce custom emojis, pinned comments, and comment thread locking, making comments require user login.

This commit is contained in:
x
2026-01-25 14:11:21 +01:00
parent 14fa613d77
commit c0ffff386a
2 changed files with 34 additions and 6 deletions

View File

@@ -47,6 +47,14 @@ class CommentSystem {
async loadComments(scrollToId = null) {
if (!this.container) return;
// If guest, hide completely and don't fetch
if (!this.user) {
this.container.innerHTML = '';
this.container.style.display = 'none';
return;
}
if (!scrollToId) this.container.innerHTML = '<div class="loading">Loading comments...</div>';
try {
@@ -54,6 +62,12 @@ class CommentSystem {
const data = await res.json();
if (data.success) {
if (data.require_login) {
this.container.innerHTML = '';
this.container.style.display = 'none'; // Ensure it takes no space
return;
}
this.isAdmin = data.is_admin || false;
this.isLocked = data.is_locked || false;
this.render(data.comments, data.user_id, data.is_subscribed);