This commit is contained in:
2026-09-11 19:40:30 +02:00
parent d72eae7509
commit 52ed9fd7bd
7 changed files with 67 additions and 30 deletions
+5 -4
View File
@@ -757,10 +757,11 @@ class CommentSystem {
// Render skeleton (Result: Layout visible immediately)
// Skip when preserveScroll=true (tab re-focus refresh): the user already sees comments,
// so wiping the DOM causes the browser to lose the #c anchor element and auto-scroll to top.
// Only render skeleton for logged-in users to avoid flashing "Login to comment" before comments/permissions load.
if (!scrollToId && !preserveScroll && this.user) {
this.render([], this.user, initialIsSubscribed);
this.restoreState(state);
if (!scrollToId && !preserveScroll) {
if (this.user || !this.container.querySelector('.login-placeholder, .comment-input, .lock-notice')) {
this.render([], this.user, initialIsSubscribed);
this.restoreState(state);
}
}
try {