feat: Introduce custom emojis, pinned comments, and comment thread locking, making comments require user login.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user