WIP: fix: include purplepage and userkindpages relays when searching for user in create page #265

Draft
m wants to merge 2 commits from issue-261 into staging
4 changed files with 18 additions and 9 deletions
Showing only changes of commit 8a9910db87 - Show all commits

8
package-lock.json generated
View File

@ -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",

View File

@ -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",

View File

@ -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)

View File

@ -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 => ({