Lighten up social graph loading

This commit is contained in:
Jon Staab 2026-07-03 16:36:52 -07:00
parent 91f0d30c84
commit 99abe17151
2 changed files with 22 additions and 18 deletions

View file

@ -1,4 +1,6 @@
<script lang="ts"> <script lang="ts">
import {remove} from "@welshman/lib"
import {pubkey} from "@welshman/app"
import CheckCircle from "@assets/icons/check-circle.svg?dataurl" import CheckCircle from "@assets/icons/check-circle.svg?dataurl"
import Icon from "@lib/components/Icon.svelte" import Icon from "@lib/components/Icon.svelte"
import RelayName from "@app/components/RelayName.svelte" import RelayName from "@app/components/RelayName.svelte"
@ -47,7 +49,7 @@
{#if !hideFavorites && $favorited.size > 0} {#if !hideFavorites && $favorited.size > 0}
<div class="flex gap-2 card card-sm"> <div class="flex gap-2 card card-sm">
Favorited By: Favorited By:
<ProfileCircles pubkeys={Array.from($favorited)} /> <ProfileCircles pubkeys={remove($pubkey!, Array.from($favorited))} />
</div> </div>
{/if} {/if}
</div> </div>

View file

@ -2,10 +2,13 @@ import {page} from "$app/stores"
import type {Unsubscriber} from "svelte/store" import type {Unsubscriber} from "svelte/store"
import {call, assoc, WEEK, MONTH, ago} from "@welshman/lib" import {call, assoc, WEEK, MONTH, ago} from "@welshman/lib"
import {merged} from "@welshman/store" import {merged} from "@welshman/store"
import {Router} from "@welshman/router"
import { import {
getListTags, getListTags,
getRelayTagValues, getRelayTagValues,
WRAP, WRAP,
MUTES,
FOLLOWS,
ROOM_META, ROOM_META,
ROOM_DELETE, ROOM_DELETE,
ROOM_ADMINS, ROOM_ADMINS,
@ -25,7 +28,7 @@ import {
unionFilters, unionFilters,
} from "@welshman/util" } from "@welshman/util"
import type {Filter, List, PublishedList, TrustedEvent} from "@welshman/util" import type {Filter, List, PublishedList, TrustedEvent} from "@welshman/util"
import {request} from "@welshman/net" import {request, load} from "@welshman/net"
import { import {
pubkey, pubkey,
loadRelay, loadRelay,
@ -54,7 +57,6 @@ import {
getSpaceRoomsFromGroupList, getSpaceRoomsFromGroupList,
} from "@app/groups" } from "@app/groups"
import {decodeRelay} from "@app/relays" import {decodeRelay} from "@app/relays"
import {loadFeedsForPubkey} from "@app/feeds"
import {RELAY_ROLE} from "@app/members" import {RELAY_ROLE} from "@app/members"
import {FEATURED_CONTENT_D} from "@app/featured" import {FEATURED_CONTENT_D} from "@app/featured"
import {BOARD, PIN} from "@app/pinboards" import {BOARD, PIN} from "@app/pinboards"
@ -244,8 +246,7 @@ const syncUserData = () => {
const syncRelayList = ($userRelayList: PublishedList | undefined) => { const syncRelayList = ($userRelayList: PublishedList | undefined) => {
const pubkey = $userRelayList?.event?.pubkey const pubkey = $userRelayList?.event?.pubkey
if (!pubkey) return if (pubkey) {
loadBlossomServerList(pubkey) loadBlossomServerList(pubkey)
loadBlockedRelayList(pubkey) loadBlockedRelayList(pubkey)
loadFollowList(pubkey) loadFollowList(pubkey)
@ -253,17 +254,19 @@ const syncUserData = () => {
loadMuteList(pubkey) loadMuteList(pubkey)
loadProfile(pubkey) loadProfile(pubkey)
loadSettings(pubkey) loadSettings(pubkey)
loadFeedsForPubkey(pubkey) }
} }
const syncFollowNetwork = ($userFollowList: List | undefined) => { const syncFollowNetwork = ($userFollowList: List | undefined) => {
const author = $userFollowList?.event?.pubkey const author = $userFollowList?.event?.pubkey
if (!author) return if (author) {
const authors = getFollows(author)
for (const follow of getFollows(author)) { load({
loadFollowList(follow) filters: [{kinds: [FOLLOWS, MUTES], authors}],
loadMuteList(follow) relays: Router.get().FromPubkeys(authors).limit(8).getUrls(),
})
} }
} }
@ -306,7 +309,6 @@ const syncSpace = (url: string) => {
signal: controller.signal, signal: controller.signal,
filters: [ filters: [
{kinds: [ROOM_META, ROOM_ADMINS, ROOM_MEMBERS, ROOM_DELETE, LIVEKIT_PARTICIPANTS, BOARD]}, {kinds: [ROOM_META, ROOM_ADMINS, ROOM_MEMBERS, ROOM_DELETE, LIVEKIT_PARTICIPANTS, BOARD]},
{kinds: [APP_DATA], "#d": [FEATURED_CONTENT_D]},
], ],
}) })