mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 08:52:25 +00:00
Render guest comment snapshots before auth gating
This commit is contained in:
1 parent
b14a7e60a0
commit
9d859b07ed
2 files changed
+63
-5
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user