Bump paravel to fix slow loading from local relay

This commit is contained in:
Jon Staab 2024-02-26 12:41:30 -08:00
parent a3d2f485a7
commit 6250a5d701
5 changed files with 7 additions and 16 deletions

View File

@ -63,7 +63,7 @@
"normalize-url": "^8.0.0",
"nostr-tools": "^2.1.5",
"npm-run-all": "^4.1.5",
"paravel": "^0.4.20",
"paravel": "^0.4.21",
"qr-scanner": "^1.4.2",
"qrcode": "^1.5.3",
"ramda": "^0.29.1",

View File

@ -7,7 +7,6 @@
import {fly} from "src/util/transition"
import {getModal} from "src/partials/state"
import Spinner from "src/partials/Spinner.svelte"
import FlexColumn from "src/partials/FlexColumn.svelte"
import FeedControls from "src/app/shared/FeedControls.svelte"
import Note from "src/app/shared/Note.svelte"
import type {DynamicFilter} from "src/engine"
@ -25,7 +24,6 @@
export let anchor = null
export let shouldDisplay = null
export let shouldListen = false
export let shouldDefer = true
export let hideControls = false
export let hideSpinner = false
export let showGroup = false
@ -60,7 +58,6 @@
filters: compileFilters([filter], {includeReposts: true}),
relays: getRelays(),
anchor,
shouldDefer,
shouldListen,
shouldLoadParents: true,
shouldHideReplies: $hideReplies,
@ -86,7 +83,7 @@
})
onMount(() => {
const scroller = createScroller(loadMore, {element: getModal(), delay: 300})
const scroller = createScroller(loadMore, {element: getModal()})
return () => {
feed?.stop()

View File

@ -146,7 +146,6 @@
<Feed
shouldListen
hideControls
shouldDefer={!address.startsWith("35834:")}
filter={{kinds: without([30402], noteKinds), "#a": [address]}}
relays={address.startsWith("35834:") ? [LOCAL_RELAY_URL] : relays} />
{:else if activeTab === "calendar"}

View File

@ -1,10 +1,9 @@
import {partition, equals, prop, uniqBy, identity, without, assoc} from "ramda"
import {partition, prop, uniqBy, identity, without, assoc} from "ramda"
import {ensurePlural, doPipe, batch} from "hurdak"
import {now} from "paravel"
import {race} from "src/util/misc"
import {info} from "src/util/logger"
import {
LOCAL_RELAY_URL,
getIdOrAddress,
getIdAndAddress,
noteKinds,
@ -94,14 +93,10 @@ export class FeedLoader {
// Wait until a good number of subscriptions have completed to reduce the chance of
// out of order notes
if (equals([LOCAL_RELAY_URL], opts.relays)) {
this.ready = Promise.resolve()
} else {
this.ready = race(
0.4,
remoteSubs.map(s => new Promise(r => s.on("close", r))),
)
}
this.ready = race(
0.4,
remoteSubs.map(s => new Promise(r => s.on("close", r))),
)
}
discardEvents(events) {

BIN
yarn.lock

Binary file not shown.