👁️
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

prefetch socials for decklist

+9 -1
+9 -1
src/routes/profile/$did/deck/$rkey/index.tsx
··· 26 26 import { useDeckValidation } from "@/hooks/useDeckValidation"; 27 27 import { asRkey } from "@/lib/atproto-client"; 28 28 import { prefetchCards } from "@/lib/card-prefetch"; 29 + import { DECK_LIST_NSID } from "@/lib/constellation-client"; 30 + import { prefetchSocialStats } from "@/lib/constellation-queries"; 29 31 import { getDeckQueryOptions, useUpdateDeckMutation } from "@/lib/deck-queries"; 30 32 import type { Deck, GroupBy, Section, SortBy } from "@/lib/deck-types"; 31 33 import { ··· 56 58 getDeckQueryOptions(params.did as Did, asRkey(params.rkey)), 57 59 ); 58 60 61 + const deckUri = 62 + `at://${params.did}/${DECK_LIST_NSID}/${params.rkey}` as const; 59 63 const cardIds = deck.cards.map((card) => card.scryfallId); 60 - await prefetchCards(context.queryClient, cardIds); 64 + 65 + await Promise.all([ 66 + prefetchCards(context.queryClient, cardIds), 67 + prefetchSocialStats(context.queryClient, deckUri, "deck"), 68 + ]); 61 69 62 70 return deck; 63 71 },