Fix some zap bugs

This commit is contained in:
Jon Staab
2025-07-07 13:58:43 -07:00
parent 63d6b362c7
commit 1d07097350
5 changed files with 53 additions and 21 deletions
@@ -3,6 +3,7 @@
import Button from "@lib/components/Button.svelte"
import Icon from "@lib/components/Icon.svelte"
import Zap from "@app/components/Zap.svelte"
import InfoZapperError from "@app/components/InfoZapperError.svelte"
import WalletConnect from "@app/components/WalletConnect.svelte"
import {pushModal} from "@app/modal"
import {wallet} from "@app/state"
@@ -12,7 +13,9 @@
const zapper = deriveZapperForPubkey(event.pubkey)
const onClick = () => {
if ($wallet) {
if (!$zapper?.allowsNostr) {
pushModal(InfoZapperError, {url, pubkey: event.pubkey, eventId: event.id})
} else if ($wallet) {
pushModal(Zap, {url, pubkey: event.pubkey, eventId: event.id})
} else {
pushModal(WalletConnect)
@@ -20,8 +23,6 @@
}
</script>
{#if $zapper?.allowsNostr}
<Button onclick={onClick} class="btn join-item btn-xs">
<Icon icon="bolt" size={4} />
</Button>
{/if}
<Button onclick={onClick} class="btn join-item btn-xs">
<Icon icon="bolt" size={4} />
</Button>