mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-01 02:12:26 +00:00
Avoid showing error before reactions pointer is ready
This commit is contained in:
1 parent
4e108f3e43
commit
f98ccc6b36
1 file changed
+12
-6
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user