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", "normalize-url": "^8.0.0",
"nostr-tools": "^2.1.5", "nostr-tools": "^2.1.5",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"paravel": "^0.4.20", "paravel": "^0.4.21",
"qr-scanner": "^1.4.2", "qr-scanner": "^1.4.2",
"qrcode": "^1.5.3", "qrcode": "^1.5.3",
"ramda": "^0.29.1", "ramda": "^0.29.1",

View File

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

View File

@ -146,7 +146,6 @@
<Feed <Feed
shouldListen shouldListen
hideControls hideControls
shouldDefer={!address.startsWith("35834:")}
filter={{kinds: without([30402], noteKinds), "#a": [address]}} filter={{kinds: without([30402], noteKinds), "#a": [address]}}
relays={address.startsWith("35834:") ? [LOCAL_RELAY_URL] : relays} /> relays={address.startsWith("35834:") ? [LOCAL_RELAY_URL] : relays} />
{:else if activeTab === "calendar"} {: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 {ensurePlural, doPipe, batch} from "hurdak"
import {now} from "paravel" import {now} from "paravel"
import {race} from "src/util/misc" import {race} from "src/util/misc"
import {info} from "src/util/logger" import {info} from "src/util/logger"
import { import {
LOCAL_RELAY_URL,
getIdOrAddress, getIdOrAddress,
getIdAndAddress, getIdAndAddress,
noteKinds, noteKinds,
@ -94,14 +93,10 @@ export class FeedLoader {
// Wait until a good number of subscriptions have completed to reduce the chance of // Wait until a good number of subscriptions have completed to reduce the chance of
// out of order notes // out of order notes
if (equals([LOCAL_RELAY_URL], opts.relays)) { this.ready = race(
this.ready = Promise.resolve() 0.4,
} else { 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) { discardEvents(events) {

BIN
yarn.lock

Binary file not shown.