Add WebLN types, only show zap button when WebLN is available
This commit is contained in:
parent
459bc72365
commit
797fca7111
5 changed files with 9 additions and 4 deletions
|
@ -91,6 +91,7 @@
|
|||
"@types/semver": "^7.3.9",
|
||||
"@types/uuid": "^9.0.0",
|
||||
"@vitejs/plugin-react": "^4.0.4",
|
||||
"@webbtc/webln-types": "^3.0.0",
|
||||
"autoprefixer": "^10.4.15",
|
||||
"axios": "^1.2.2",
|
||||
"axios-mock-adapter": "^1.22.0",
|
||||
|
|
|
@ -57,9 +57,7 @@ function useSignerStream() {
|
|||
return;
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
await window.webln?.enable();
|
||||
// @ts-ignore
|
||||
await window.webln?.sendPayment(reqMsg.data.params.invoice);
|
||||
}
|
||||
|
||||
|
|
|
@ -791,7 +791,7 @@ const StatusActionBar: React.FC<IStatusActionBar> = ({
|
|||
/>
|
||||
)}
|
||||
|
||||
{acceptsZaps && (
|
||||
{(acceptsZaps && window.webln) && (
|
||||
<StatusActionButton
|
||||
title={intl.formatMessage(messages.zap)}
|
||||
icon={require('@tabler/icons/bolt.svg')}
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
"types": [
|
||||
"vite/client",
|
||||
"vitest/globals",
|
||||
"vite-plugin-compile-time/client"
|
||||
"vite-plugin-compile-time/client",
|
||||
"@webbtc/webln-types"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2902,6 +2902,11 @@
|
|||
"@webassemblyjs/ast" "1.11.6"
|
||||
"@xtuc/long" "4.2.2"
|
||||
|
||||
"@webbtc/webln-types@^3.0.0":
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@webbtc/webln-types/-/webln-types-3.0.0.tgz#448b2138423865087ba8859e9e6430fc2463b864"
|
||||
integrity sha512-aXfTHLKz5lysd+6xTeWl+qHNh/p3qVYbeLo+yDN5cUDmhie2ZoGvkppfWxzbGkcFBzb6dJyQ2/i2cbmDHas+zQ==
|
||||
|
||||
"@xtuc/ieee754@^1.2.0":
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790"
|
||||
|
|
Loading…
Reference in a new issue