{
- if (props.url.startsWith("http")) {
- window.location.href = props.url;
- } else {
- navigate(props.url);
- }
- }}>
-
- {props.logo}
+ return (
+
{
+ if (props.url.startsWith("http")) {
+ window.location.href = props.url;
+ } else {
+ navigate(props.url);
+ }
+ }}>
+
+ {props.logo}
+
+
+
{props.name}
+
{props.desc}
+
+
-
-
{props.name}
-
{props.desc}
-
-
-
-}
+ );
+};
const WalletSettings = () => {
const alby = getAlbyOAuth();
@@ -42,30 +46,37 @@ const WalletSettings = () => {
logo={
}
name="Nostr Wallet Connect"
url="/settings/wallet/nwc"
- desc={
} />
+ desc={
}
+ />
}
name="LND via LNC"
url="/settings/wallet/lnc"
- desc={
} />
+ desc={
+
+ }
+ />
}
name="LNDHub"
url="/settings/wallet/lndhub"
- desc={
} />
+ desc={
}
+ />
}
name="Cashu"
url="/settings/wallet/cashu"
- desc={
} />
+ desc={
}
+ />
}
name="Alby"
url={alby.authUrl}
- desc={
} />
+ desc={
}
+ />
>
);
};
-export default WalletSettings;
\ No newline at end of file
+export default WalletSettings;
diff --git a/packages/app/src/Pages/settings/wallet/Alby.tsx b/packages/app/src/Pages/settings/wallet/Alby.tsx
index ff5b6559..235d4d86 100644
--- a/packages/app/src/Pages/settings/wallet/Alby.tsx
+++ b/packages/app/src/Pages/settings/wallet/Alby.tsx
@@ -6,93 +6,89 @@ import { useEffect, useState } from "react";
import { useLocation } from "react-router-dom";
export default function AlbyOAuth() {
- const location = useLocation();
- const alby = getAlbyOAuth();
- const [error, setError] = useState("");
+ const location = useLocation();
+ const alby = getAlbyOAuth();
+ const [error, setError] = useState("");
- async function setupWallet(token: string) {
- const auth = await alby.getToken(token);
- console.debug(auth);
+ async function setupWallet(token: string) {
+ const auth = await alby.getToken(token);
+ console.debug(auth);
+ }
+
+ useEffect(() => {
+ if (location.search) {
+ const params = new URLSearchParams(location.search);
+ const token = params.get("code");
+ if (token) {
+ setupWallet(token).catch(e => {
+ setError((e as Error).message);
+ });
+ }
}
+ }, [location]);
- useEffect(() => {
- if (location.search) {
- const params = new URLSearchParams(location.search);
- const token = params.get("code");
- if (token) {
- setupWallet(token).catch(e => {
- setError((e as Error).message);
- });
- }
- }
- }, [location]);
-
- if (!location.search) return;
- return <>
-