From 8a9910db87dcd27488ef1588a18e4480b16adde8 Mon Sep 17 00:00:00 2001 From: Stixx Date: Mon, 2 Dec 2024 11:51:02 +0100 Subject: [PATCH] fix: include purplepage and userkindpages relays when searching for user in create page --- package-lock.json | 8 ++++---- package.json | 2 +- src/pages/create/index.tsx | 13 +++++++++++-- src/utils/relays.ts | 4 ++-- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index a03e759..0b038f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "jszip": "3.10.1", "lodash": "4.17.21", "mui-file-input": "4.0.4", - "nostr-login": "^1.6.6", + "nostr-login": "file:../../nostrdev-com/nostr-login/packages/auth/dist/nostr-login-1.6.12.tgz", "nostr-tools": "2.7.0", "pdf-lib": "^1.17.1", "pdfjs-dist": "^4.4.168", @@ -6415,9 +6415,9 @@ } }, "node_modules/nostr-login": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/nostr-login/-/nostr-login-1.6.6.tgz", - "integrity": "sha512-XOpB9nG3Qgt7iea7gA1zn4TaTfUKCKGdCHKwErqLPtMk/q1Rhkzj5cq/66iU0WqC6mSiwENfTy1p4qaM7HzMtg==", + "version": "1.6.12", + "resolved": "file:../../nostrdev-com/nostr-login/packages/auth/dist/nostr-login-1.6.12.tgz", + "integrity": "sha512-7qqhWSrA3Hr/An2+s7JIr1HhIpOsdwfNRgKBctPLrfjIQbiMYQd8/S25Pvv20s09yA/tS8zPgWYUUdeKoPDDNg==", "license": "MIT", "dependencies": { "@nostr-dev-kit/ndk": "^2.3.1", diff --git a/package.json b/package.json index ab49da0..2357f80 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "jszip": "3.10.1", "lodash": "4.17.21", "mui-file-input": "4.0.4", - "nostr-login": "^1.6.6", + "nostr-login": "file:../../nostrdev-com/nostr-login/packages/auth/dist/nostr-login-1.6.12.tgz", "nostr-tools": "2.7.0", "pdf-lib": "^1.17.1", "pdfjs-dist": "^4.4.168", diff --git a/src/pages/create/index.tsx b/src/pages/create/index.tsx index a65a559..0ad59ea 100644 --- a/src/pages/create/index.tsx +++ b/src/pages/create/index.tsx @@ -52,7 +52,8 @@ import { updateUsersAppData, uploadToFileStorage, DEFAULT_TOOLBOX, - settleAllFullfilfedPromises + settleAllFullfilfedPromises, + DEFAULT_LOOK_UP_RELAY_LIST } from '../../utils' import { Container } from '../../components/Container' import fileListStyles from '../../components/FileList/style.module.scss' @@ -159,6 +160,14 @@ export const CreatePage = () => { const metadataController = MetadataController.getInstance() const relaySet = await metadataController.findRelayListMetadata(usersPubkey) + + DEFAULT_LOOK_UP_RELAY_LIST.forEach((relay) => { + if (!relaySet.write.includes(relay)) relaySet.write.push(relay) + if (!relaySet.read.includes(relay)) relaySet.read.push(relay) + }) + + const uniqueReadRelaySet = [...new Set(relaySet.read)] + const searchTerm = searchString.trim() relayController @@ -167,7 +176,7 @@ export const CreatePage = () => { kinds: [0], search: searchTerm }, - [...relaySet.write] + uniqueReadRelaySet ) .then((events) => { console.log('events', events) diff --git a/src/utils/relays.ts b/src/utils/relays.ts index bfef7aa..7a0ad56 100644 --- a/src/utils/relays.ts +++ b/src/utils/relays.ts @@ -80,8 +80,8 @@ const getUserRelaySet = (tags: string[][]): RelaySet => { } const getDefaultRelaySet = (): RelaySet => ({ - read: [SIGIT_RELAY], - write: [SIGIT_RELAY] + read: DEFAULT_LOOK_UP_RELAY_LIST, + write: DEFAULT_LOOK_UP_RELAY_LIST }) const getDefaultRelayMap = (): RelayMap => ({ -- 2.34.1