From fa67cbc5dc2fc440e2b2928c737506893c9f1569 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 17 Oct 2025 23:00:23 -0400 Subject: [PATCH] Improve zap popover toggles --- js/channelProfile.js | 10 +++++++++- js/ui/components/VideoModal.js | 14 +++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/js/channelProfile.js b/js/channelProfile.js index 50a70863..c9056e8c 100644 --- a/js/channelProfile.js +++ b/js/channelProfile.js @@ -1241,6 +1241,9 @@ async function executePendingRetry({ walletSettings }) { function handleZapButtonClick(event) { if (event) { event.preventDefault(); + if (typeof event.stopPropagation === "function") { + event.stopPropagation(); + } } const zapButton = getChannelZapButton(); @@ -1248,7 +1251,12 @@ function handleZapButtonClick(event) { return; } - if (!isZapControlsOpen()) { + const popoverIsOpen = + typeof zapPopover?.isOpen === "function" + ? zapPopover.isOpen() + : isZapControlsOpen(); + + if (!popoverIsOpen) { openZapControls({ focus: true }); return; } diff --git a/js/ui/components/VideoModal.js b/js/ui/components/VideoModal.js index b195788d..7f1264cb 100644 --- a/js/ui/components/VideoModal.js +++ b/js/ui/components/VideoModal.js @@ -408,14 +408,22 @@ export class VideoModal { if (this.modalZapBtn) { this.modalZapBtn.addEventListener("click", (event) => { event?.preventDefault?.(); + event?.stopPropagation?.(); + if (this.modalZapBtn?.disabled) { return; } - const isExpanded = - this.modalZapBtn.getAttribute("aria-expanded") === "true"; + const popoverIsOpen = + typeof this.modalZapPopover?.isOpen === "function" + ? this.modalZapPopover.isOpen() + : this.modalZapDialogOpen === true; + + if (popoverIsOpen) { + if (this.modalZapPending) { + return; + } - if (isExpanded) { this.closeZapDialog(); return; }