Skip to content

Commit

Permalink
Merge branch 'master' into feat/secret-key-rename
Browse files Browse the repository at this point in the history
  • Loading branch information
reneaaron committed Jul 28, 2023
2 parents aefac35 + 84fe120 commit 9441cf6
Show file tree
Hide file tree
Showing 24 changed files with 44 additions and 49 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@scure/bip32": "^1.3.1",
"@scure/bip39": "^1.2.1",
"@scure/btc-signer": "^0.5.1",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/forms": "^0.5.4",
"@vespaiach/axios-fetch-adapter": "^0.3.0",
"alby-js-sdk": "^2.1.0",
"axios": "^0.27.2",
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/AccountDetailLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function AccountDetailLayout() {
/>
<h2
title={account.name}
className="text-xl font-semibold dark:text-white overflow-hidden text-ellipsis whitespace-nowrap leading-1 my-2"
className="text-xl font-semibold dark:text-white overflow-hidden text-ellipsis whitespace-nowrap my-2"
>
{account.name}
</h2>
Expand Down
3 changes: 3 additions & 0 deletions src/app/components/AccountMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ function AccountMenu({ showOptions = true }: Props) {
key={accountId}
onClick={() => {
selectAccount(accountId);
if (window.location.pathname !== "/prompt.html") {
navigate("/");
}
}}
disabled={accountLoading}
title={account.name}
Expand Down
3 changes: 0 additions & 3 deletions src/app/screens/Accounts/Detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ function AccountDetail() {
id="name"
label={t("name.title")}
placeholder={t("name.placeholder")}
type="text"
value={accountName}
onChange={(event) => {
setAccountName(event.target.value);
Expand Down Expand Up @@ -294,7 +293,6 @@ function AccountDetail() {
<TextField
id="uri"
label={t("export.export_uri")}
type="text"
readOnly
value={`lndhub://${lndHubData.login}:${lndHubData.password}@${lndHubData.url}/`}
/>
Expand Down Expand Up @@ -391,7 +389,6 @@ function AccountDetail() {
<TextField
id="nostrPublicKey"
label={t("nostr.public_key.label")}
type="text"
value={nostrPublicKey}
disabled
endAdornment={
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/Accounts/NostrSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ function NostrSettings() {
<TextField
id="nostrPrivateKey"
label={t("nostr.private_key.label")}
autoComplete="new-password"
type={nostrPrivateKeyVisible ? "text" : "password"}
value={nostrPrivateKey}
onChange={(event) => {
Expand Down Expand Up @@ -214,7 +215,6 @@ function NostrSettings() {
<TextField
id="nostrPublicKey"
label={t("nostr.public_key.label")}
type="text"
value={nostrPublicKey}
disabled
endAdornment={<InputCopyButton value={nostrPublicKey} />}
Expand Down
1 change: 0 additions & 1 deletion src/app/screens/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ function Settings() {
<div className="w-64">
<Input
placeholder={t("name.placeholder")}
type="text"
value={settings.userName}
onChange={(event) => {
saveSetting({
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/connectors/ConnectCitadel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export default function ConnectCitadel() {
<TextField
label={t("password.label")}
id="password"
autoComplete="new-password"
type={passwordView ? "text" : "password"}
autoFocus={true}
required
Expand All @@ -138,7 +139,6 @@ export default function ConnectCitadel() {
label={t("url.label")}
id="url"
placeholder={t("url.placeholder")}
type="text"
value={formData.url}
required
onChange={handleChange}
Expand Down
5 changes: 1 addition & 4 deletions src/app/screens/connectors/ConnectCommando/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ export default function ConnectCommando() {
<TextField
id="host"
label={t("host.label")}
type="text"
required
placeholder="0.0.0.0"
title="host"
Expand All @@ -127,7 +126,6 @@ export default function ConnectCommando() {
<TextField
id="pubkey"
label={t("pubkey.label")}
type="text"
required
placeholder="02...."
title="pubkey"
Expand All @@ -139,7 +137,6 @@ export default function ConnectCommando() {
<TextField
id="rune"
label={t("rune.label")}
type="text"
required
placeholder=""
title="rune"
Expand Down Expand Up @@ -170,7 +167,6 @@ export default function ConnectCommando() {
<TextField
id="proxy"
label={t("proxy.label")}
type="text"
placeholder="proxy"
required
title="proxy"
Expand All @@ -182,6 +178,7 @@ export default function ConnectCommando() {
id="commandoPrivateKey"
label={t("privKey.label")}
type={commandoPrivateKeyVisible ? "text" : "password"}
autoComplete="new-password"
value={formData.privateKey}
endAdornment={
<button
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/connectors/ConnectEclair/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export default function ConnectEclair() {
<div className="mb-6">
<TextField
id="password"
autoComplete="new-password"
label={t("password.label")}
type={passwordView ? "text" : "password"}
required
Expand All @@ -121,7 +122,6 @@ export default function ConnectEclair() {
<TextField
id="url"
label={t("url.label")}
type="text"
placeholder={t("url.placeholder")}
value={formData.url}
required
Expand Down
1 change: 0 additions & 1 deletion src/app/screens/connectors/ConnectGaloy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ export default function ConnectGaloy(props: Props) {
<Input
id="jwt"
name="jwt"
type="text"
required
onChange={handleJwtChange}
autoFocus={true}
Expand Down
1 change: 0 additions & 1 deletion src/app/screens/connectors/ConnectKollider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ export default function ConnectKollidier({ variant }: Props) {
<TextField
id="username"
label={t(`username.label`)}
type="text"
required
value={formData.username}
onChange={handleChange}
Expand Down
2 changes: 0 additions & 2 deletions src/app/screens/connectors/ConnectLnbits/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export default function ConnectLnbits() {
id="adminkey"
label={t("admin_key.label")}
placeholder={t("admin_key.placeholder")}
type="text"
required
onChange={handleChange}
autoFocus={true}
Expand All @@ -118,7 +117,6 @@ export default function ConnectLnbits() {
<TextField
id="url"
label={t("url.label")}
type="text"
value={formData.url}
required
onChange={handleChange}
Expand Down
1 change: 1 addition & 0 deletions src/app/screens/connectors/ConnectLnc/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default function ConnectLnd() {
<div className="mt-6">
<TextField
id="pairingPhrase"
autoComplete="new-password"
type="password"
label={t("pairing_phrase.label")}
placeholder={t("pairing_phrase.placeholder")}
Expand Down
2 changes: 2 additions & 0 deletions src/app/screens/connectors/ConnectLnd/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ export default function ConnectLnd() {
<div>
<TextField
id="macaroon"
type="password"
autoComplete="new-password"
label={t("macaroon.label")}
value={formData.macaroon}
onChange={handleChange}
Expand Down
1 change: 0 additions & 1 deletion src/app/screens/connectors/ConnectLndHub/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export default function ConnectLndHub({
<TextField
id="uri"
label={t("uri.label")}
type="text"
required
placeholder="lndhub://..."
pattern="lndhub://.+"
Expand Down
2 changes: 2 additions & 0 deletions src/app/screens/connectors/ConnectMyNode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ export default function ConnectMyNode() {
<TextField
id="lndconnect"
label={t("rest_url.label")}
type="password"
autoComplete="new-password"
placeholder={t("rest_url.placeholder")}
onChange={handleLndconnectUrl}
required
Expand Down
2 changes: 2 additions & 0 deletions src/app/screens/connectors/ConnectRaspiBlitz/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ export default function ConnectRaspiBlitz() {
<div>
<TextField
id="macaroon"
type="password"
autoComplete="new-password"
label="Macaroon (HEX format)"
value={formData.macaroon}
onChange={handleMacaroon}
Expand Down
2 changes: 2 additions & 0 deletions src/app/screens/connectors/ConnectStart9/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ export default function ConnectStart9() {
<div className="mt-6">
<TextField
id="lndconnect"
type="password"
autoComplete="new-password"
label={t("rest_url.label")}
placeholder={t("rest_url.placeholder")}
onChange={handleLndconnectUrl}
Expand Down
2 changes: 2 additions & 0 deletions src/app/screens/connectors/ConnectUmbrel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ export default function ConnectUmbrel() {
<div className="mt-6">
<TextField
id="lndconnect"
type="password"
autoComplete="new-password"
label={t("rest_url.label")}
placeholder={t("rest_url.placeholder")}
onChange={handleLndconnectUrl}
Expand Down
9 changes: 0 additions & 9 deletions src/extension/background-script/connectors/alby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,6 @@ export default class Alby implements Connector {
return authResult;
}

async getAccessToken(authResult: string, authClient: auth.OAuth2User) {
const authToken = new URL(authResult).searchParams.get("code");
if (!authToken) {
throw new Error("Authentication failed: missing token");
}

await authClient.requestAccessToken(authToken);
}

private async _request<T>(func: (client: Client) => T) {
if (!this._authUser || !this._client) {
throw new Error("Alby client was not initialized");
Expand Down
15 changes: 7 additions & 8 deletions src/extension/providers/alby/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ export default class AlbyProvider {
this.enabled = false;
}

enable() {
async enable() {
if (this.enabled) {
return Promise.resolve({ enabled: true });
return { enabled: true };
}
return this.execute("enable").then((result) => {
if (typeof result.enabled === "boolean") {
this.enabled = result.enabled;
}
return result;
});
const result = await this.execute("enable");
if (typeof result.enabled === "boolean") {
this.enabled = result.enabled;
}
return result;
}

/**
Expand Down
6 changes: 5 additions & 1 deletion src/extension/providers/nostr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ export default class NostrProvider {
if (this.enabled) {
return { enabled: true };
}
return await this.execute("enable");
const result = await this.execute("enable");
if (typeof result.enabled === "boolean") {
this.enabled = result.enabled;
}
return result;
}

async getPublicKey() {
Expand Down
17 changes: 8 additions & 9 deletions src/extension/providers/webln/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,16 @@ export default class WebLNProvider {
this.executing = false;
}

enable() {
async enable() {
if (this.enabled) {
return Promise.resolve({ enabled: true });
return { enabled: true };
}
return this.execute("enable").then((result) => {
if (typeof result.enabled === "boolean") {
this.enabled = result.enabled;
this.isEnabled = result.enabled;
}
return result;
});
const result = await this.execute("enable");
if (typeof result.enabled === "boolean") {
this.enabled = result.enabled;
this.isEnabled = result.enabled;
}
return result;
}

getInfo() {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1230,10 +1230,10 @@
"@jest/create-cache-key-function" "^27.4.2"
jsonc-parser "^3.2.0"

"@tailwindcss/forms@^0.5.3":
version "0.5.3"
resolved "https://registry.yarnpkg.com/@tailwindcss/forms/-/forms-0.5.3.tgz#e4d7989686cbcaf416c53f1523df5225332a86e7"
integrity sha512-y5mb86JUoiUgBjY/o6FJSFZSEttfb3Q5gllE4xoKjAAD+vBrnIhE4dViwUuow3va8mpH4s9jyUbUbrRGoRdc2Q==
"@tailwindcss/forms@^0.5.4":
version "0.5.4"
resolved "https://registry.yarnpkg.com/@tailwindcss/forms/-/forms-0.5.4.tgz#5316a782fd95369eb5b6fd01d46323b3dce656a2"
integrity sha512-YAm12D3R7/9Mh4jFbYSMnsd6jG++8KxogWgqs7hbdo/86aWjjlIEvL7+QYdVELmAI0InXTpZqFIg5e7aDVWI2Q==
dependencies:
mini-svg-data-uri "^1.2.3"

Expand Down

0 comments on commit 9441cf6

Please sign in to comment.