Zaps with POW UX
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Kieran 2023-08-18 19:11:31 +01:00
parent 2720854b72
commit f1bfc2f3a6
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -17,6 +17,7 @@ import { useWallet } from "Wallet";
import useLogin from "Hooks/useLogin";
import { generateRandomKey } from "Login";
import { ZapPoolController } from "ZapPoolController";
import AsyncButton from "Element/AsyncButton";
import messages from "./messages";
@ -121,8 +122,8 @@ export default function SendSats(props: SendSatsProps) {
setAmount(a);
};
async function loadInvoice() {
if (!amount || !handler || !publisher) return null;
async function loadInvoice(): Promise<void> {
if (!amount || !handler || !publisher) return;
let zap: NostrEvent | undefined;
if (author && zapType !== ZapType.NonZap) {
@ -250,7 +251,7 @@ export default function SendSats(props: SendSatsProps) {
</div>
{zapTypeSelector()}
{(amount ?? 0) > 0 && (
<button type="button" className="zap-action" onClick={() => loadInvoice()}>
<AsyncButton className="zap-action" onClick={() => loadInvoice()}>
<div className="zap-action-container">
<Icon name="zap" />
{target ? (
@ -259,7 +260,7 @@ export default function SendSats(props: SendSatsProps) {
<FormattedMessage {...messages.ZapSats} values={{ n: formatShort(amount) }} />
)}
</div>
</button>
</AsyncButton>
)}
</>
);