Render guest comment snapshots before auth gating

This commit is contained in:
thePR0M3TH3AN committed 2026-01-02 11:08:28 -05:00
1 parent b14a7e60a0
commit 9d859b07ed
2 files changed
+63 -5

No files matched your search

+9 -5
View File
@@ -201,7 +201,6 @@ export default class VideoModalCommentController {
this.videoModal.clearComments?.();
this.videoModal.resetCommentComposer?.();
this.videoModal.setCommentStatus?.("Loading comments…");
this.applyCommentComposerAuthState();
const loadPromise = this.commentThreadService.loadThread({
video,
@@ -216,11 +215,15 @@ export default class VideoModalCommentController {
this.modalCommentLoadPromise = loadPromise;
loadPromise
.then(() => {
.then((snapshot) => {
if (this.modalCommentLoadPromise === loadPromise) {
this.modalCommentLoadPromise = null;
}
this.applyCommentComposerAuthState();
const didRenderSnapshot = this.handleCommentThreadReady(snapshot);
if (didRenderSnapshot === false) {
this.applyCommentComposerAuthState();
}
})
.catch((error) => {
if (this.modalCommentLoadPromise === loadPromise) {
@@ -355,14 +358,14 @@ export default class VideoModalCommentController {
handleCommentThreadReady(snapshot) {
if (!snapshot || !this.videoModal) {
return;
return false;
}
const snapshotVideoEventId = normalizeHexId(snapshot.videoEventId);
const modalVideoEventId = normalizeHexId(this.modalCommentState.videoEventId);
if (!snapshotVideoEventId || snapshotVideoEventId !== modalVideoEventId) {
return;
return false;
}
this.modalCommentProfiles = this.createMapFromInput(snapshot.profiles, {
@@ -405,6 +408,7 @@ export default class VideoModalCommentController {
this.videoModal.renderComments?.(sanitizedSnapshot);
this.videoModal.setCommentStatus?.("");
this.applyCommentComposerAuthState();
return true;
}
handleCommentThreadAppend(payload) {