Stop loading profiles eagerly
This commit is contained in:
@@ -1,13 +1,12 @@
|
|||||||
import {partition} from "@welshman/lib"
|
import {partition} from "@welshman/lib"
|
||||||
import {defaultOptimizeSubscriptions, getDefaultNetContext as originalGetDefaultNetContext} from "@welshman/net"
|
import {defaultOptimizeSubscriptions, getDefaultNetContext as originalGetDefaultNetContext} from "@welshman/net"
|
||||||
import type {Subscription, RelaysAndFilters, NetContext} from "@welshman/net"
|
import type {Subscription, RelaysAndFilters, NetContext} from "@welshman/net"
|
||||||
import {WRAP, LOCAL_RELAY_URL, isEphemeralKind, isDVMKind, unionFilters} from "@welshman/util"
|
import {LOCAL_RELAY_URL, isEphemeralKind, isDVMKind, unionFilters} from "@welshman/util"
|
||||||
import type {TrustedEvent, StampedEvent} from "@welshman/util"
|
import type {TrustedEvent, StampedEvent} from "@welshman/util"
|
||||||
import {tracker, repository} from './core'
|
import {tracker, repository} from './core'
|
||||||
import {makeRouter, getFilterSelections} from './router'
|
import {makeRouter, getFilterSelections} from './router'
|
||||||
import {signer} from './session'
|
import {signer} from './session'
|
||||||
import type {Router} from './router'
|
import type {Router} from './router'
|
||||||
import {loadProfile} from './profiles'
|
|
||||||
|
|
||||||
export type AppContext = {
|
export type AppContext = {
|
||||||
router: Router
|
router: Router
|
||||||
@@ -26,11 +25,6 @@ export const getDefaultNetContext = (overrides: Partial<NetContext> = {}) => ({
|
|||||||
|
|
||||||
tracker.track(event.id, url)
|
tracker.track(event.id, url)
|
||||||
repository.publish(event)
|
repository.publish(event)
|
||||||
|
|
||||||
// Eagerly load profiles since they're critical to UX
|
|
||||||
if (event.kind !== WRAP) {
|
|
||||||
loadProfile(event.pubkey)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
isDeleted: (url: string, event: TrustedEvent) => repository.isDeleted(event),
|
isDeleted: (url: string, event: TrustedEvent) => repository.isDeleted(event),
|
||||||
optimizeSubscriptions: (subs: Subscription[]) => {
|
optimizeSubscriptions: (subs: Subscription[]) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user