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

+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;
}