diff --git a/package-lock.json b/package-lock.json index f7cc2baea..c29ef20d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,15 +27,15 @@ "@types/throttle-debounce": "^5.0.2", "@vite-pwa/assets-generator": "^0.2.6", "@vite-pwa/sveltekit": "^0.6.6", - "@welshman/app": "~0.0.20", + "@welshman/app": "~0.0.23", "@welshman/content": "~0.0.12", "@welshman/dvm": "~0.0.10", - "@welshman/feeds": "~0.0.21", - "@welshman/lib": "~0.0.23", - "@welshman/net": "~0.0.31", - "@welshman/signer": "~0.0.10", + "@welshman/feeds": "~0.0.23", + "@welshman/lib": "~0.0.24", + "@welshman/net": "~0.0.33", + "@welshman/signer": "~0.0.11", "@welshman/store": "~0.0.12", - "@welshman/util": "~0.0.42", + "@welshman/util": "~0.0.45", "daisyui": "^4.12.10", "date-picker-svelte": "^2.13.0", "dotenv": "^16.4.5", @@ -3639,18 +3639,18 @@ } }, "node_modules/@welshman/app": { - "version": "0.0.20", - "resolved": "https://registry.npmjs.org/@welshman/app/-/app-0.0.20.tgz", - "integrity": "sha512-hStVq7HUQAYvaT1lV8Z7e0zNU/qMMc/oXIoo3/o7B42aHomHuziUKtXCMCJvBhpStpT0x3atcmvWeTvsZwPPTw==", + "version": "0.0.23", + "resolved": "https://registry.npmjs.org/@welshman/app/-/app-0.0.23.tgz", + "integrity": "sha512-WafnbcQ5htVivIastgXPXAk7Ysne9SZ9w0C/yrqj6ngY7XTldVulEK1IZg1/qaaYK5WFcg7DmZbEzPIRGPlRlA==", "license": "MIT", "dependencies": { "@welshman/dvm": "~0.0.10", - "@welshman/feeds": "~0.0.20", - "@welshman/lib": "~0.0.23", - "@welshman/net": "~0.0.30", - "@welshman/signer": "~0.0.10", - "@welshman/store": "~0.0.11", - "@welshman/util": "~0.0.42", + "@welshman/feeds": "~0.0.23", + "@welshman/lib": "~0.0.24", + "@welshman/net": "~0.0.33", + "@welshman/signer": "~0.0.11", + "@welshman/store": "~0.0.12", + "@welshman/util": "~0.0.45", "fuse.js": "^7.0.0", "idb": "^8.0.0", "svelte": "^4.2.18", @@ -3678,19 +3678,19 @@ } }, "node_modules/@welshman/feeds": { - "version": "0.0.21", - "resolved": "https://registry.npmjs.org/@welshman/feeds/-/feeds-0.0.21.tgz", - "integrity": "sha512-ssxHEQdYkXpSTBXL6NiXr+Cs7tat00K4ZS4YvoVIbV+PJgKW2e5NG6LKwZJUh7NzwVW+TjYUKlmiJQbGocTpFQ==", + "version": "0.0.23", + "resolved": "https://registry.npmjs.org/@welshman/feeds/-/feeds-0.0.23.tgz", + "integrity": "sha512-EHS+C3ne4k8BLlEv6Medg9eQAEmOEUhh8eucYM/6bz/YF9+eQBXRdYtQI+9LAQnlmjgxA7Ul/2+mBt4kw+byNg==", "license": "MIT", "dependencies": { - "@welshman/lib": "~0.0.23", - "@welshman/util": "~0.0.42" + "@welshman/lib": "~0.0.24", + "@welshman/util": "~0.0.45" } }, "node_modules/@welshman/lib": { - "version": "0.0.23", - "resolved": "https://registry.npmjs.org/@welshman/lib/-/lib-0.0.23.tgz", - "integrity": "sha512-BmY14Sc8FpR7ERMl7B6pOXzoo8C1ifYd+YXMKIJSJjd5jh3DasVIX7euioXkOtPR7YiNOwbuEexZVn39k/NQLw==", + "version": "0.0.24", + "resolved": "https://registry.npmjs.org/@welshman/lib/-/lib-0.0.24.tgz", + "integrity": "sha512-MQxCt02IzenSv2hpe/Y2/Gtki/evBprW4EqV7pwO7h2HAjfr1Lo1OYu0b2t6sSTbiFMdIkKIOOWYyeBEFggXQQ==", "license": "MIT", "dependencies": { "@scure/base": "^1.1.6", @@ -3701,9 +3701,9 @@ } }, "node_modules/@welshman/net": { - "version": "0.0.31", - "resolved": "https://registry.npmjs.org/@welshman/net/-/net-0.0.31.tgz", - "integrity": "sha512-7UcEuU65XJTtphjtgGPTNO0InOHm9iqvsmsmhRk7QTNALDkIcqofL3TjnI32zPYJhq5QVIO8tXj04iXsld0OdQ==", + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@welshman/net/-/net-0.0.33.tgz", + "integrity": "sha512-v2wtVBHX6VpyK2nFRnL+bJLPrN80EkViJDyXN8cycJYC/aDOi/sMe9TJFK/iWHkyKPFhN/4jdf8mNm1qHEwT0A==", "license": "MIT", "dependencies": { "@welshman/lib": "~0.0.23", @@ -3713,9 +3713,9 @@ } }, "node_modules/@welshman/signer": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/@welshman/signer/-/signer-0.0.10.tgz", - "integrity": "sha512-6PNnWN2BbmjSEBXvpO9RSQg+TOCXZHnMf0r/OeW1a4KfUkRgeevDg0TqVQLnvO9xYNi6rnrFLcrSqiVvVeag4g==", + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/@welshman/signer/-/signer-0.0.11.tgz", + "integrity": "sha512-1OGGocazvbakjIjN5LcR72fBvZeAG0jnPqRYShHVdeGFpsg5UiUyCiqUf7Dyd8fo6KOYk/HVsv0O6f7Pb6I52g==", "license": "MIT", "dependencies": { "@welshman/lib": "~0.0.23", @@ -3739,12 +3739,12 @@ } }, "node_modules/@welshman/util": { - "version": "0.0.42", - "resolved": "https://registry.npmjs.org/@welshman/util/-/util-0.0.42.tgz", - "integrity": "sha512-pNMHZuORLsIdIsrM3mid5ESSdNgrzNHCrn1mF0XG1/g+ihKgfcAQwSburnoeWtgGiS4z9MqkcUPFkwwZ6LdWZg==", + "version": "0.0.45", + "resolved": "https://registry.npmjs.org/@welshman/util/-/util-0.0.45.tgz", + "integrity": "sha512-6ktWY/LQsBqVYN+PIfT7Aob48QDf4XjXOI1aDJ7tsewaG4FKuMDy9rfHE7/FjVMGhYrKsugaL2GBVFcS4UfRTg==", "license": "MIT", "dependencies": { - "@welshman/lib": "~0.0.23", + "@welshman/lib": "~0.0.24", "nostr-tools": "^2.7.2" } }, diff --git a/package.json b/package.json index cfe91fed7..303efbb26 100644 --- a/package.json +++ b/package.json @@ -52,15 +52,15 @@ "@types/throttle-debounce": "^5.0.2", "@vite-pwa/assets-generator": "^0.2.6", "@vite-pwa/sveltekit": "^0.6.6", - "@welshman/app": "~0.0.20", + "@welshman/app": "~0.0.23", "@welshman/content": "~0.0.12", "@welshman/dvm": "~0.0.10", - "@welshman/feeds": "~0.0.21", - "@welshman/lib": "~0.0.23", - "@welshman/net": "~0.0.31", - "@welshman/signer": "~0.0.10", + "@welshman/feeds": "~0.0.23", + "@welshman/lib": "~0.0.24", + "@welshman/net": "~0.0.33", + "@welshman/signer": "~0.0.11", "@welshman/store": "~0.0.12", - "@welshman/util": "~0.0.42", + "@welshman/util": "~0.0.45", "daisyui": "^4.12.10", "date-picker-svelte": "^2.13.0", "dotenv": "^16.4.5", diff --git a/src/app/commands.ts b/src/app/commands.ts index 2a785a06c..d9e1d052b 100644 --- a/src/app/commands.ts +++ b/src/app/commands.ts @@ -22,7 +22,7 @@ import { } from "@welshman/util" import type {TrustedEvent, EventTemplate, List} from "@welshman/util" import type {SubscribeRequestWithHandlers, Subscription} from "@welshman/net" -import {PublishStatus, AuthStatus, ConnectionStatus} from "@welshman/net" +import {PublishStatus, AuthStatus, SocketStatus} from "@welshman/net" import {Nip59, makeSecret, stamp, Nip46Broker} from "@welshman/signer" import type {Nip46Handler} from "@welshman/signer" import { @@ -268,8 +268,7 @@ export const setInboxRelayPolicy = (url: string, enabled: boolean) => { export const checkRelayAccess = async (url: string, claim = "") => { const connection = ctx.net.pool.get(url) - await connection.auth.attemptIfRequested() - await connection.auth.waitIfPending() + await connection.auth.attempt() const thunk = publishThunk({ event: createEvent(AUTH_JOIN, {tags: [["claim", claim]]}), @@ -298,11 +297,10 @@ export const checkRelayProfile = async (url: string) => { export const checkRelayConnection = async (url: string) => { const connection = ctx.net.pool.get(url) - const okStatuses = [ConnectionStatus.Ok, ConnectionStatus.Slow] - await connection.ensureConnected() + await connection.socket.open() - if (!okStatuses.includes(connection.meta.getStatus())) { + if (connection.socket.status !== SocketStatus.Open) { return `Failed to connect` } } @@ -311,8 +309,7 @@ export const checkRelayAuth = async (url: string) => { const connection = ctx.net.pool.get(url) const okStatuses = [AuthStatus.None, AuthStatus.Ok] - await connection.auth.attemptIfRequested() - await connection.auth.waitIfPending() + await connection.auth.attempt() if (!okStatuses.includes(connection.auth.status)) { return `Failed to authenticate: "${connection.auth.message}"` diff --git a/src/app/components/ProfileDetail.svelte b/src/app/components/ProfileDetail.svelte deleted file mode 100644 index e6bca5376..000000000 --- a/src/app/components/ProfileDetail.svelte +++ /dev/null @@ -1,47 +0,0 @@ - - -
-