diff --git a/relays.yaml b/relays.yaml index d7d8ac3..a6c3ff7 100644 --- a/relays.yaml +++ b/relays.yaml @@ -212,4 +212,7 @@ relays: - wss://relay.nosphr.com - wss://rsslay.nostr.moe - wss://relay.nostr.scot + - wss://relay.nostrich.de + - wss://nostr.mouton.dev + - wss://nostr.handyjunky.com - wss://student.chadpolytechnic.com diff --git a/scripts/relays.js b/scripts/relays.js index a2f49b2..bd99c90 100644 --- a/scripts/relays.js +++ b/scripts/relays.js @@ -118,12 +118,14 @@ const sanitizeRelay = function(relay) { } const checkRemoteRelays = async function(){ - for(let i=0;i Math.random() - 0.5) + + for(let i=0;i { - remove.push(relaysRemote[i]) - //console.log('removals:', remove.length, relaysRemote[i]) + remove.push(randomlyOrderedRelays[i]) + //console.log('removals:', remove.length, randomlyOrderedRelays[i]) }) } } @@ -145,4 +147,4 @@ const removeOfflineRelays = function(){ relaysRemote = relaysRemote.filter( relay => !remove.includes(relay) ) } -run() \ No newline at end of file +run() diff --git a/src/components/relays/partials/NostrSync.vue b/src/components/relays/partials/NostrSync.vue index 006eed5..0f96d37 100644 --- a/src/components/relays/partials/NostrSync.vue +++ b/src/components/relays/partials/NostrSync.vue @@ -162,8 +162,10 @@ export default defineComponent({ return console.log('valid event?', ok, veryOk) + + const relaysWrite = Object.keys(this.store.user.kind3).filter( key => this.store.user.kind3[key].write) - const pool = new RelayPool( Object.keys(this.store.user.kind3) ) + const pool = new RelayPool( relaysWrite ) pool.on('open', relay=>{ relay.send(['EVENT', signedEvent]) diff --git a/src/store/user.js b/src/store/user.js index 4843a66..b2987f9 100644 --- a/src/store/user.js +++ b/src/store/user.js @@ -63,7 +63,7 @@ export const useUserStore = defineStore('user', { // reject(err) }) setTimeout( () => { - ordered.sort( (a, b) => a.created_at - b.created_at ) + ordered.sort( (a, b) => b.created_at - a.created_at ) if(!ordered.length) return this.kind3Event = ordered[0] @@ -79,7 +79,7 @@ export const useUserStore = defineStore('user', { if(obj instanceof Object && Object.keys(obj).length) this.kind3 = obj else - this.kind3 = Object.assign(this.kind3, await this.retrieveKind3()) + this.kind3 = Object.assign(await this.retrieveKind3(), this.kind3) }, setPublicKey: function(pubKey){ this.pubKey = pubKey }, setProfile: function(stringifiedEvContent){