Improve zap popover toggles

This commit is contained in:
thePR0M3TH3AN committed 2025-10-17 23:00:23 -04:00
1 parent d1ea1a316c
commit fa67cbc5dc
2 files changed
+20 -4

No files matched your search

+9 -1
View File
@@ -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;
}
+11 -3
View File
@@ -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;
}