diff --git a/package.json b/package.json index fd83e792..1ddd9fa6 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@getalby/lightning-tools": "^6.1.0", "@getalby/sdk": "^5.1.2", "@noble/curves": "^1.9.7", - "@pomade/core": "^0.0.12", + "@pomade/core": "^0.1.0", "@poppanator/sveltekit-svg": "^4.2.1", "@sveltejs/adapter-static": "^3.0.10", "@tiptap/core": "^2.27.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6658938e..b642cf85 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ^1.9.7 version: 1.9.7 '@pomade/core': - specifier: ^0.0.12 - version: 0.0.12(@frostr/bifrost@1.0.7(typescript@5.9.3))(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/signer@0.8.4(@noble/curves@1.9.7)(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@8.0.1))(nostr-tools@2.20.0(typescript@5.9.3)))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-tools@2.20.0(typescript@5.9.3)) + specifier: ^0.1.0 + version: 0.1.0(@frostr/bifrost@1.0.7(typescript@5.9.3))(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/signer@0.8.4(@noble/curves@1.9.7)(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@8.0.1))(nostr-tools@2.20.0(typescript@5.9.3)))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-tools@2.20.0(typescript@5.9.3)) '@poppanator/sveltekit-svg': specifier: ^4.2.1 version: 4.2.1(rollup@2.79.2)(svelte@5.48.0)(svgo@3.3.2)(vite@5.4.21(@types/node@25.0.10)(terser@5.46.0)) @@ -82,7 +82,7 @@ importers: version: 0.6.8(@sveltejs/kit@2.50.1(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.48.0)(vite@5.4.21(@types/node@25.0.10)(terser@5.46.0)))(svelte@5.48.0)(typescript@5.9.3)(vite@5.4.21(@types/node@25.0.10)(terser@5.46.0)))(@vite-pwa/assets-generator@0.2.6)(vite-plugin-pwa@0.21.2(@vite-pwa/assets-generator@0.2.6)(vite@5.4.21(@types/node@25.0.10)(terser@5.46.0))(workbox-build@7.3.0)(workbox-window@7.3.0)) '@welshman/app': specifier: ^0.8.4 - version: 0.8.4(8cf13c6f89f01abf88d7a500e2fe9622) + version: 0.8.4(a2db52c3b1cee53016a2bf402df2a47a) '@welshman/content': specifier: ^0.8.4 version: 0.8.4(nostr-tools@2.20.0(typescript@5.9.3)) @@ -1301,8 +1301,8 @@ packages: '@polka/url@1.0.0-next.29': resolution: {integrity: sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==} - '@pomade/core@0.0.12': - resolution: {integrity: sha512-xI8DSPwpm8m124RjHmcpko3lCvfobNwwl11Fkvpt5L6vgORFMGFA6UM2PGBfgKcVAXR/ao957Hza6yYpMNHEGQ==} + '@pomade/core@0.1.0': + resolution: {integrity: sha512-ZVR+u1bUOIjCYVcZMlkC1rKFyHvg5NLaqvtpniiOF8qhtwpJLTGCRGjg0LyTRJrWSyrLKY/qLzblJ38SRamK8A==} engines: {node: '>=12.0.0'} peerDependencies: '@frostr/bifrost': ^1.0.7 @@ -6115,7 +6115,7 @@ snapshots: '@polka/url@1.0.0-next.29': {} - '@pomade/core@0.0.12(@frostr/bifrost@1.0.7(typescript@5.9.3))(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/signer@0.8.4(@noble/curves@1.9.7)(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@8.0.1))(nostr-tools@2.20.0(typescript@5.9.3)))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-tools@2.20.0(typescript@5.9.3))': + '@pomade/core@0.1.0(@frostr/bifrost@1.0.7(typescript@5.9.3))(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/signer@0.8.4(@noble/curves@1.9.7)(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@8.0.1))(nostr-tools@2.20.0(typescript@5.9.3)))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-tools@2.20.0(typescript@5.9.3))': dependencies: '@frostr/bifrost': 1.0.7(typescript@5.9.3) '@noble/hashes': 2.0.1 @@ -6648,9 +6648,9 @@ snapshots: optionalDependencies: '@vite-pwa/assets-generator': 0.2.6 - '@welshman/app@0.8.4(8cf13c6f89f01abf88d7a500e2fe9622)': + '@welshman/app@0.8.4(a2db52c3b1cee53016a2bf402df2a47a)': dependencies: - '@pomade/core': 0.0.12(@frostr/bifrost@1.0.7(typescript@5.9.3))(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/signer@0.8.4(@noble/curves@1.9.7)(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@8.0.1))(nostr-tools@2.20.0(typescript@5.9.3)))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-tools@2.20.0(typescript@5.9.3)) + '@pomade/core': 0.1.0(@frostr/bifrost@1.0.7(typescript@5.9.3))(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/signer@0.8.4(@noble/curves@1.9.7)(@noble/hashes@2.0.1)(@welshman/lib@0.8.4)(@welshman/net@0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@8.0.1))(nostr-tools@2.20.0(typescript@5.9.3)))(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(nostr-tools@2.20.0(typescript@5.9.3)) '@welshman/feeds': 0.8.4(6a543d5393e091f4351d8cc1a0e86321) '@welshman/lib': 0.8.4 '@welshman/net': 0.8.4(@welshman/lib@0.8.4)(@welshman/util@0.8.4(@noble/curves@1.9.7)(@welshman/lib@0.8.4)(nostr-tools@2.20.0(typescript@5.9.3)))(ws@8.18.3) diff --git a/src/app/components/KeyRecoveryConfirm.svelte b/src/app/components/KeyRecoveryConfirm.svelte index caa02412..82ed7314 100644 --- a/src/app/components/KeyRecoveryConfirm.svelte +++ b/src/app/components/KeyRecoveryConfirm.svelte @@ -51,7 +51,7 @@ return pushToast({ theme: "error", - message: `Failed to recover: ${request.messages[0]?.payload.message.toLowerCase()}`, + message: `Failed to recover: ${request.messages[0]?.res?.message.toLowerCase()}`, }) } @@ -62,7 +62,7 @@ return pushToast({ theme: "error", - message: `Failed to recover: ${result.messages[0]?.payload.message.toLowerCase()}`, + message: `Failed to recover: ${result.messages[0]?.res?.message.toLowerCase()}`, }) } diff --git a/src/app/components/PomadeSessions.svelte b/src/app/components/PomadeSessions.svelte index b3b77c47..6567b462 100644 --- a/src/app/components/PomadeSessions.svelte +++ b/src/app/components/PomadeSessions.svelte @@ -17,35 +17,28 @@ if (!isPomadeSession($session)) return const client = new Client($session.clientOptions) + const result = await client.listSessions() + const pubkey = await client.getPubkey() - try { - const result = await client.listSessions() - const pubkey = await client.getPubkey() + if (result.ok) { + // Group sessions by client pubkey and collect peers + const sessionMap = new Map() - if (result.ok) { - // Group sessions by client pubkey and collect peers - const sessionMap = new Map() + for (const message of result.messages) { + if (!message.res?.items) continue - for (const message of result.messages) { - if (!message?.payload.items) continue + for (const item of message.res.items) { + const existing = sessionMap.get(item.client) - const peer = message.event.pubkey - - for (const item of message.payload.items) { - const existing = sessionMap.get(item.client) - - if (existing) { - existing.peers.push(peer) - } else if (item.client !== pubkey) { - sessionMap.set(item.client, {...item, peers: [peer]}) - } + if (existing) { + existing.peers.push(message.url) + } else if (item.client !== pubkey) { + sessionMap.set(item.client, {...item, peers: [message.url]}) } } - - sessions = Array.from(sessionMap.values()) } - } finally { - client.stop() + + sessions = Array.from(sessionMap.values()) } } @@ -71,8 +64,6 @@ message: "Failed to delete session", }) } - - client.stop() } catch (e) { console.error(e) pushToast({ diff --git a/src/app/components/ProfileEdit.svelte b/src/app/components/ProfileEdit.svelte index 84f7fa7d..9979f9bb 100644 --- a/src/app/components/ProfileEdit.svelte +++ b/src/app/components/ProfileEdit.svelte @@ -2,6 +2,8 @@ import type {Profile} from "@welshman/util" import {getTag, makeProfile} from "@welshman/util" import {pubkey, profilesByPubkey} from "@welshman/app" + import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl" + import Icon from "@lib/components/Icon.svelte" import Button from "@lib/components/Button.svelte" import ProfileEditForm from "@app/components/ProfileEditForm.svelte" import {clearModals} from "@app/util/modal" @@ -24,9 +26,10 @@ {#snippet footer()} -
- - -
+ + {/snippet}
diff --git a/src/app/components/ProfileEditForm.svelte b/src/app/components/ProfileEditForm.svelte index 1a6de4eb..df706135 100644 --- a/src/app/components/ProfileEditForm.svelte +++ b/src/app/components/ProfileEditForm.svelte @@ -10,6 +10,7 @@ import Button from "@lib/components/Button.svelte" import Modal from "@lib/components/Modal.svelte" import ModalBody from "@lib/components/ModalBody.svelte" + import ModalFooter from "@lib/components/ModalFooter.svelte" import InputProfilePicture from "@app/components/InputProfilePicture.svelte" import InfoHandle from "@app/components/InfoHandle.svelte" import {pushModal} from "@app/util/modal" @@ -123,5 +124,7 @@ {/if} - {@render footer()} + + {@render footer()} + diff --git a/src/app/components/SignUpEmail.svelte b/src/app/components/SignUpEmail.svelte index d76c39f3..7f53072c 100644 --- a/src/app/components/SignUpEmail.svelte +++ b/src/app/components/SignUpEmail.svelte @@ -39,8 +39,6 @@ loading = true - let client: Client | undefined = undefined - try { const secret = getKey("signup.secret")! const {clientOptions, ...registerRes} = await Client.register(2, 3, secret) @@ -52,12 +50,11 @@ }) } - client = new Client(clientOptions) - + const client = new Client(clientOptions) const setupRes = await client.setupRecovery(email, password) if (!setupRes.ok) { - const message = setupRes.messages[0]?.payload.message || "Please try again." + const message = setupRes.messages[0]?.res?.message || "Please try again." return pushToast({ theme: "error", @@ -86,7 +83,6 @@ message: "Failed to register! Please try again.", }) } finally { - client?.stop() loading = false } } diff --git a/src/app/components/SignUpProfile.svelte b/src/app/components/SignUpProfile.svelte index 30e8887b..1f7ec57e 100644 --- a/src/app/components/SignUpProfile.svelte +++ b/src/app/components/SignUpProfile.svelte @@ -7,7 +7,6 @@ import Button from "@lib/components/Button.svelte" import Modal from "@lib/components/Modal.svelte" import ModalBody from "@lib/components/ModalBody.svelte" - import ModalFooter from "@lib/components/ModalFooter.svelte" import ProfileEditForm from "@app/components/ProfileEditForm.svelte" type Props = { @@ -32,16 +31,14 @@ {#snippet footer()} - - - - + + {/snippet} diff --git a/src/app/core/state.ts b/src/app/core/state.ts index 9ef3abca..76938495 100644 --- a/src/app/core/state.ts +++ b/src/app/core/state.ts @@ -289,7 +289,7 @@ export const deriveRelaySignedEvents = (url: string, filters: Filter[] = [{}]) = // Context -pomadeContext.setSignerPubkeys(POMADE_SIGNERS) +pomadeContext.setSignerUrls(POMADE_SIGNERS) pomadeContext.setArgonWorker(import("@pomade/core/argon-worker.js?worker")) diff --git a/src/routes/discover/+page.svelte b/src/routes/discover/+page.svelte index 8dc228d0..f0acff69 100644 --- a/src/routes/discover/+page.svelte +++ b/src/routes/discover/+page.svelte @@ -86,7 +86,7 @@ Find communities all across the nostr network {/snippet} -
+
- - - {#snippet icon()} - - {/snippet} - {#snippet title()} -
Browse the network
- {/snippet} - {#snippet info()} -
Find communities on the nostr network.
- {/snippet} -