Avoid showing error before reactions pointer is ready

This commit is contained in:
thePR0M3TH3AN committed 2025-10-23 10:15:07 -04:00
1 parent 4e108f3e43
commit f98ccc6b36
1 file changed
+12 -6
+12 -6
View File
@@ -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) {