mirror of
https://github.com/vitorpamplona/Nostryfied.git
synced 2025-04-19 10:21:17 +00:00
Sorts the exported file by time.
This commit is contained in:
parent
a8a98d3b89
commit
6698849aad
@ -34,10 +34,9 @@ const fetchAndBroadcast = async () => {
|
||||
|
||||
// get all events from relays
|
||||
const filters =[{ authors: [pubkey] }, { "#p": [pubkey] }]
|
||||
const data = await getEvents(filters, pubkey)
|
||||
|
||||
const kind3 = data.filter((it) => it.kind == 3 && it.pubkey === pubkey).sort((a, b) => b.created_at - a.created_at)[0]
|
||||
const myRelaySet = JSON.parse(kind3.content)
|
||||
const data = (await getEvents(filters, pubkey)).sort((a, b) => b.created_at - a.created_at)
|
||||
const latestKind3 = data.filter((it) => it.kind == 3 && it.pubkey === pubkey)[0]
|
||||
const myRelaySet = JSON.parse(latestKind3.content)
|
||||
relays = Object.keys(myRelaySet).filter(url => myRelaySet[url].write).map(url => url)
|
||||
|
||||
$('#checking-relays-header-box').css('display', 'none')
|
||||
|
@ -98,7 +98,7 @@ function hexToBytes(hex) {
|
||||
myTimeout = setTimeout(() => {
|
||||
ws.close()
|
||||
reject('timeout')
|
||||
}, 5_000)
|
||||
}, 10_000)
|
||||
|
||||
const { id } = data
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user