Add WebLN types, only show zap button when WebLN is available

environments/review-zaps-fm6a7d/deployments/4373
Alex Gleason 2024-01-22 14:37:44 -06:00
rodzic 459bc72365
commit 797fca7111
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
5 zmienionych plików z 9 dodań i 4 usunięć

Wyświetl plik

@ -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",

Wyświetl plik

@ -57,9 +57,7 @@ function useSignerStream() {
return;
}
// @ts-ignore
await window.webln?.enable();
// @ts-ignore
await window.webln?.sendPayment(reqMsg.data.params.invoice);
}

Wyświetl plik

@ -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')}

Wyświetl plik

@ -24,7 +24,8 @@
"types": [
"vite/client",
"vitest/globals",
"vite-plugin-compile-time/client"
"vite-plugin-compile-time/client",
"@webbtc/webln-types"
]
}
}

Wyświetl plik

@ -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"