diff --git a/src/partials/Note.svelte b/src/partials/Note.svelte index f1345a52..35d4baa5 100644 --- a/src/partials/Note.svelte +++ b/src/partials/Note.svelte @@ -182,7 +182,7 @@ {/if} {#each note.replies as r (r.id)} - {#if r.created_at < until} + {#if r.created_at <= until} {/if} {/each} diff --git a/src/partials/Notes.svelte b/src/partials/Notes.svelte index e9b308a6..ea9fadb1 100644 --- a/src/partials/Notes.svelte +++ b/src/partials/Notes.svelte @@ -29,7 +29,7 @@ $: newNotes = ($notes || []).filter(e => e.created_at > until) $: newNotesLength = reject(findReply, newNotes).length - $: visibleNotes = ($notes || []).filter(e => e.created_at < until) + $: visibleNotes = ($notes || []).filter(e => e.created_at <= until) onMount(() => { const scroller = createScroller(loadNotes) diff --git a/src/routes/RelayList.svelte b/src/routes/RelayList.svelte index 2fab9f83..aee92b29 100644 --- a/src/routes/RelayList.svelte +++ b/src/routes/RelayList.svelte @@ -3,18 +3,12 @@ import {fuzzy} from "src/util/misc" import Input from "src/partials/Input.svelte" import Anchor from "src/partials/Anchor.svelte" - import {modal, settings} from "src/state/app" + import {modal} from "src/state/app" import relay, {connections} from 'src/relay' let q = "" let search - fetch($settings.dufflepudUrl + '/relay').then(r => r.json()).then(({relays}) => { - for (const url of relays) { - relay.db.relays.put({url}) - } - }) - const knownRelays = relay.lq(() => relay.db.relays.toArray()) $: search = fuzzy($knownRelays, {keys: ["name", "description", "url"]}) diff --git a/src/state/app.js b/src/state/app.js index 7103b07e..2469adbd 100644 --- a/src/state/app.js +++ b/src/state/app.js @@ -1,7 +1,8 @@ -import {writable} from 'svelte/store' +import {writable, get} from 'svelte/store' import {navigate} from "svelte-routing" import {globalHistory} from "svelte-routing/src/history" import {getLocalJson, setLocalJson, now, timedelta} from "src/util/misc" +import relay from 'src/relay' // Modals @@ -46,3 +47,50 @@ export const alerts = writable({ alerts.subscribe($alerts => { setLocalJson("coracle/alerts", $alerts) }) + +// Populate relays initially. Hardcode some, load the rest asynchronously + +fetch(get(settings).dufflepudUrl + '/relay').then(r => r.json()).then(({relays}) => { + for (const url of relays) { + relay.db.relays.put({url}) + } +}) + +const defaultRelays = [ + 'wss://no.contry.xyz', + 'wss://nostr.ethtozero.fr', + 'wss://relay.nostr.ro', + 'wss://nostr.actn.io', + 'wss://relay.realsearch.cc', + 'wss://nostr.mrbits.it', + 'wss://relay.nostr.vision', + 'wss://nostr.massmux.com', + 'wss://nostr.robotechy.com', + 'wss://satstacker.cloud', + 'wss://relay.kronkltd.net', + 'wss://nostr.developer.li', + 'wss://nostr.vulpem.com', + 'wss://nostr.openchain.fr', + 'wss://nostr-01.bolt.observer', + 'wss://nostr.oxtr.dev', + 'wss://nostr.zebedee.cloud', + 'wss://nostr-verif.slothy.win', + 'wss://nostr.rewardsbunny.com', + 'wss://nostr.onsats.org', + 'wss://relay.boring.surf', + 'wss://no.str.watch', + 'wss://relay.nostr.pro', + 'wss://nostr.ono.re', + 'wss://nostr.rocks', + 'wss://btc.klendazu.com', + 'wss://nostr-relay.untethr.me', + 'wss://nostr.orba.ca', + 'wss://sg.qemura.xyz', + 'wss://nostr.hyperlingo.com', + 'wss://nostr.d11n.net', + 'wss://relay.nostr.express', +] + +for (const url of defaultRelays) { + relay.db.relays.put({url}) +}