mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-30 01:12:39 +00:00
Improve zap popover toggles
This commit is contained in:
1 parent
d1ea1a316c
commit
fa67cbc5dc
2 files changed
+20
-4
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user