Merge pull request 'fix: include purplepage and userkindpages relays when searching for user in create page' (#265) from issue-261 into staging
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m45s

Reviewed-on: #265
Reviewed-by: enes <enes@noreply.git.nostrdev.com>
This commit is contained in:
b 2024-12-18 09:14:21 +00:00
commit 3a74bddb30
5 changed files with 27 additions and 10 deletions

8
package-lock.json generated
View File

@ -33,7 +33,7 @@
"lodash": "4.17.21", "lodash": "4.17.21",
"material-ui-popup-state": "^5.3.1", "material-ui-popup-state": "^5.3.1",
"mui-file-input": "4.0.4", "mui-file-input": "4.0.4",
"nostr-login": "^1.6.6", "nostr-login": "1.6.14",
"nostr-tools": "2.7.0", "nostr-tools": "2.7.0",
"pdf-lib": "^1.17.1", "pdf-lib": "^1.17.1",
"pdfjs-dist": "^4.4.168", "pdfjs-dist": "^4.4.168",
@ -6442,9 +6442,9 @@
} }
}, },
"node_modules/nostr-login": { "node_modules/nostr-login": {
"version": "1.6.6", "version": "1.6.14",
"resolved": "https://registry.npmjs.org/nostr-login/-/nostr-login-1.6.6.tgz", "resolved": "https://registry.npmjs.org/nostr-login/-/nostr-login-1.6.14.tgz",
"integrity": "sha512-XOpB9nG3Qgt7iea7gA1zn4TaTfUKCKGdCHKwErqLPtMk/q1Rhkzj5cq/66iU0WqC6mSiwENfTy1p4qaM7HzMtg==", "integrity": "sha512-pId1G79kjRW1B9qy6OrA8Not23JSfgmS2VegcKf7Qm9VMC7wYGXg1Ry3FMEAB8p11WoboQ8oJi2TqUGiOf61OQ==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@nostr-dev-kit/ndk": "^2.3.1", "@nostr-dev-kit/ndk": "^2.3.1",

View File

@ -43,7 +43,7 @@
"lodash": "4.17.21", "lodash": "4.17.21",
"material-ui-popup-state": "^5.3.1", "material-ui-popup-state": "^5.3.1",
"mui-file-input": "4.0.4", "mui-file-input": "4.0.4",
"nostr-login": "^1.6.6", "nostr-login": "1.6.14",
"nostr-tools": "2.7.0", "nostr-tools": "2.7.0",
"pdf-lib": "^1.17.1", "pdf-lib": "^1.17.1",
"pdfjs-dist": "^4.4.168", "pdfjs-dist": "^4.4.168",

View File

@ -134,7 +134,15 @@ export const MainLayout = () => {
initNostrLogin({ initNostrLogin({
methods: ['connect', 'extension', 'local'], methods: ['connect', 'extension', 'local'],
noBanner: true, noBanner: true,
onAuth: handleNostrAuth onAuth: handleNostrAuth,
outboxRelays: [
'wss://purplepag.es',
'wss://relay.nos.social',
'wss://user.kindpag.es',
'wss://relay.damus.io',
'wss://nos.lol',
'wss://relay.sigit.io'
]
}).catch((error) => { }).catch((error) => {
console.error('Failed to initialize Nostr-Login', error) console.error('Failed to initialize Nostr-Login', error)
}) })

View File

@ -52,7 +52,8 @@ import {
updateUsersAppData, updateUsersAppData,
uploadToFileStorage, uploadToFileStorage,
DEFAULT_TOOLBOX, DEFAULT_TOOLBOX,
settleAllFullfilfedPromises settleAllFullfilfedPromises,
DEFAULT_LOOK_UP_RELAY_LIST
} from '../../utils' } from '../../utils'
import { Container } from '../../components/Container' import { Container } from '../../components/Container'
import fileListStyles from '../../components/FileList/style.module.scss' import fileListStyles from '../../components/FileList/style.module.scss'
@ -170,6 +171,14 @@ export const CreatePage = () => {
const metadataController = MetadataController.getInstance() const metadataController = MetadataController.getInstance()
const relaySet = await metadataController.findRelayListMetadata(usersPubkey) 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() const searchTerm = searchString.trim()
relayController relayController
@ -178,7 +187,7 @@ export const CreatePage = () => {
kinds: [0], kinds: [0],
search: searchTerm search: searchTerm
}, },
[...relaySet.write] uniqueReadRelaySet
) )
.then((events) => { .then((events) => {
console.log('events', events) console.log('events', events)

View File

@ -80,8 +80,8 @@ const getUserRelaySet = (tags: string[][]): RelaySet => {
} }
const getDefaultRelaySet = (): RelaySet => ({ const getDefaultRelaySet = (): RelaySet => ({
read: [SIGIT_RELAY], read: DEFAULT_LOOK_UP_RELAY_LIST,
write: [SIGIT_RELAY] write: DEFAULT_LOOK_UP_RELAY_LIST
}) })
const getDefaultRelayMap = (): RelayMap => ({ const getDefaultRelayMap = (): RelayMap => ({