From 7c03500caa3c594a1aa284e9d533761f47ecc6bc Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 25 Sep 2024 13:59:21 -0700 Subject: move nwc string --- src/components/Account.svelte | 2 - src/locales/en.json | 2 + .../(app)/[username]/(profile)/+layout.svelte | 31 ---------- src/routes/(app)/account/[id]/+page.svelte | 67 ++++++++++++++++------ 4 files changed, 51 insertions(+), 51 deletions(-) (limited to 'src') diff --git a/src/components/Account.svelte b/src/components/Account.svelte index a57fff12..4f615c49 100644 --- a/src/components/Account.svelte +++ b/src/components/Account.svelte @@ -21,13 +21,11 @@ - {#if seed} - {/if}
diff --git a/src/locales/en.json b/src/locales/en.json index 8e2c93c3..fe67a2b7 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,5 +1,7 @@ { "accounts": { + "showQR": "Show QR", + "revealNwc": "Reveal NWC", "finish": "Finish", "back": "Back", "next": "Next", diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index cd6a44a7..c6dc6569 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -6,10 +6,6 @@ import { sign, send } from "$lib/nostr"; import { bech32m } from "@scure/base"; import { page } from "$app/stores"; - import { - PUBLIC_COINOS_PUBKEY as pk, - PUBLIC_COINOS_RELAY as relay, - } from "$env/static/public"; export let data; @@ -27,12 +23,6 @@ $: lnaddr = `${stripped}@${$page.url.host}`; $: profile = `${$page.url.host}/${stripped}`; - $: nwc = - user && - `nostr+walletconnect://${pk}?relay=${encodeURIComponent(relay)}&secret=${ - user.nwc - }`; - let follow = async () => { user.follows.push(["p", subject.pubkey, "wss://nostr.coinos.io", stripped]); update(); @@ -174,27 +164,6 @@
- {#if user.id === subject.id} -
-
{$t("user.nwc")}
-
-
- {nwc} -
-
- - - - -
-
-
- {/if} {/if} diff --git a/src/routes/(app)/account/[id]/+page.svelte b/src/routes/(app)/account/[id]/+page.svelte index 76473a89..3f7bb900 100644 --- a/src/routes/(app)/account/[id]/+page.svelte +++ b/src/routes/(app)/account/[id]/+page.svelte @@ -9,6 +9,10 @@ import { decrypt } from "nostr-tools/nip49"; import { entropyToMnemonic, mnemonicToSeed } from "@scure/bip39"; import { wordlist } from "@scure/bip39/wordlists/english"; + import { + PUBLIC_COINOS_PUBKEY as pk, + PUBLIC_COINOS_RELAY as relay, + } from "$env/static/public"; export let data; let { account, user } = data; @@ -32,6 +36,12 @@ fail(e.message); } }; + +let nwc; + let revealNwc = () => + (nwc = `nostr+walletconnect://${pk}?relay=${encodeURIComponent( + relay + )}&secret=${user.nwc}`);
@@ -39,17 +49,7 @@
- - - - -
- - - - - {#if mnemonic} @@ -70,17 +70,48 @@
{$t("accounts.revealMnemonic")}
+ {:else if nwc} +
+ {nwc} +
+ + + + + {:else} + {/if} {#if seed} - + {/if}
-- cgit v1.2.3