From f98ccc6b36b380e7c54b5aa5f4884f4ff72fe0e3 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Thu, 23 Oct 2025 10:15:07 -0400 Subject: [PATCH] Avoid showing error before reactions pointer is ready --- js/app.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/js/app.js b/js/app.js index 5d5f9f9f..42707260 100644 --- a/js/app.js +++ b/js/app.js @@ -2081,12 +2081,6 @@ class Application { return; } - const pointer = this.currentVideoPointer; - if (!pointer) { - this.showError("Reactions are unavailable for this video."); - return; - } - const requestedReaction = typeof detail.reaction === "string" ? detail.reaction : ""; const normalizedReaction = @@ -2101,6 +2095,17 @@ class Application { } const previousReaction = this.modalReactionState?.userReaction || ""; + const pointer = this.currentVideoPointer; + const pointerKey = this.currentVideoPointerKey || pointerArrayToKey(pointer); + if (!pointer || !pointerKey) { + if (this.videoModal) { + this.videoModal.setUserReaction(previousReaction); + } + devLogger.info( + "[reaction] Ignoring reaction request until modal pointer is available.", + ); + return; + } if (normalizedReaction === previousReaction) { return; } @@ -2125,6 +2130,7 @@ class Application { content: normalizedReaction, video: this.currentVideo, currentVideoPubkey: this.currentVideo?.pubkey, + pointerKey, }); if (!result?.ok) {