From 79482f07b176836775b3287e5d82e60ff79ab153 Mon Sep 17 00:00:00 2001 From: whey.party Date: Tue, 13 Jan 2026 06:33:01 +0000 Subject: [PATCH] Polls refresh state button --- src/components/UniversalPostRenderer.tsx | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------- src/providers/PollMutationQueueProvider.tsx | 232 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------- src/utils/followState.ts | 26 ++++++++++++++------------ src/utils/useQuery.ts | 9 +++++++++ 4 file(s) changed, 305 insertion(s)(+), 132 deletion(s)(-) diff --git a/src/components/UniversalPostRenderer.tsx b/src/components/UniversalPostRenderer.tsx --- a/src/components/UniversalPostRenderer.tsx +++ b/src/components/UniversalPostRenderer.tsx @@ -408,7 +408,7 @@ setReplies( links ? links?.links?.["app.bsky.feed.post"]?.[".reply.parent.uri"] - ?.records || 0 + ?.records || 0 : null, ); }, [links]); @@ -456,13 +456,13 @@ const replyAturis = repliesData ? repliesData.pages.flatMap((page) => - page - ? page.linking_records.map((record) => { - const aturi = `at://${record.did}/${record.collection}/${record.rkey}`; - return aturi; - }) - : [], - ) + page + ? page.linking_records.map((record) => { + const aturi = `at://${record.did}/${record.collection}/${record.rkey}`; + return aturi; + }) + : [], + ) : []; //const [oldestOpsReply, setOldestOpsReply] = useState(undefined); @@ -622,7 +622,7 @@ opacity: 0.5, }} className="dark:bg-[repeating-linear-gradient(to_bottom,var(--color-gray-500)_0,var(--color-gray-400)_4px,transparent_4px,transparent_8px)]" - //className="border-gray-400 dark:border-gray-500" + //className="border-gray-400 dark:border-gray-500" /> @@ -768,11 +768,11 @@ const isQuotewithImages = isquotewithmedia && (hasEmbed as ATPAPI.AppBskyEmbedRecordWithMedia.Main)?.media?.$type === - "app.bsky.embed.images"; + "app.bsky.embed.images"; const isQuotewithVideo = isquotewithmedia && (hasEmbed as ATPAPI.AppBskyEmbedRecordWithMedia.Main)?.media?.$type === - "app.bsky.embed.video"; + "app.bsky.embed.video"; const hasMedia = hasEmbed && @@ -1258,6 +1258,7 @@ import defaultpfp from "~/../public/favicon.png"; import { usePollData, + usePollMutationQueue, } from "~/providers/PollMutationQueueProvider"; import { useAuth } from "~/providers/UnifiedAuthProvider"; import { renderSnack } from "~/routes/__root"; @@ -1494,18 +1495,18 @@ const tags = unfediwafrnTags ? unfediwafrnTags - .split("\n") - .map((t) => t.trim()) - .filter(Boolean) + .split("\n") + .map((t) => t.trim()) + .filter(Boolean) : undefined; const links = tags ? tags - .map((tag) => { - const encoded = encodeURIComponent(tag); - return `#${tag.replaceAll(" ", "-")}`; - }) - .join("
") + .map((tag) => { + const encoded = encodeURIComponent(tag); + return `#${tag.replaceAll(" ", "-")}`; + }) + .join("
") : ""; const unfediwafrn = unfediwafrnPartial @@ -1518,7 +1519,7 @@ /* fuck you */ const isMainItem = false; - const setMainItem = (any: any) => { }; + const setMainItem = (any: any) => {}; // eslint-disable-next-line react-hooks/refs //console.log("Received ref in UniversalPostRenderer:", usedref); return ( @@ -1532,12 +1533,12 @@ : setMainItem ? onPostClick ? (e) => { - setMainItem({ post: post }); - onPostClick(e); - } + setMainItem({ post: post }); + onPostClick(e); + } : () => { - setMainItem({ post: post }); - } + setMainItem({ post: post }); + } : undefined } style={{ @@ -2020,10 +2021,10 @@ try { await navigator.clipboard.writeText( "https://bsky.app" + - "/profile/" + - post.author.handle + - "/post/" + - post.uri.split("/").pop(), + "/profile/" + + post.author.handle + + "/post/" + + post.uri.split("/").pop(), ); renderSnack({ title: "Copied to clipboard!", @@ -2131,7 +2132,7 @@ | AppBskyEmbedVideo.View | AppBskyEmbedExternal.View | AppBskyEmbedRecordWithMedia.View - | { $type: string;[k: string]: unknown }; + | { $type: string; [k: string]: unknown }; enum PostEmbedViewContext { ThreadHighlighted = "ThreadHighlighted", @@ -2148,6 +2149,7 @@ function PollEmbed({ did, rkey }: { did: string; rkey: string }) { const { agent } = useAuth(); + const { refreshPollData } = usePollMutationQueue(); const pollUri = `at://${did}/app.reddwarf.embed.poll/${rkey}`; const { data: pollRecord, isLoading, error } = useQueryArbitrary(pollUri); @@ -2159,6 +2161,7 @@ target: pollUri, collection: "app.reddwarf.poll.vote.a", path: ".subject.uri", + customkey: "constellation-polls", }); const { data: voteCountsB } = useQueryConstellation({ @@ -2166,6 +2169,7 @@ target: pollUri, collection: "app.reddwarf.poll.vote.b", path: ".subject.uri", + customkey: "constellation-polls", }); const { data: voteCountsC } = useQueryConstellation({ @@ -2173,6 +2177,7 @@ target: pollUri, collection: "app.reddwarf.poll.vote.c", path: ".subject.uri", + customkey: "constellation-polls", }); const { data: voteCountsD } = useQueryConstellation({ @@ -2180,20 +2185,37 @@ target: pollUri, collection: "app.reddwarf.poll.vote.d", path: ".subject.uri", + customkey: "constellation-polls", }); // Query first page of voters for Avatars const { data: votersA } = useQueryConstellation({ - method: "/links", target: pollUri, collection: "app.reddwarf.poll.vote.a", path: ".subject.uri", + method: "/links", + target: pollUri, + collection: "app.reddwarf.poll.vote.a", + path: ".subject.uri", + customkey: "constellation-polls", }); const { data: votersB } = useQueryConstellation({ - method: "/links", target: pollUri, collection: "app.reddwarf.poll.vote.b", path: ".subject.uri", + method: "/links", + target: pollUri, + collection: "app.reddwarf.poll.vote.b", + path: ".subject.uri", + customkey: "constellation-polls", }); const { data: votersC } = useQueryConstellation({ - method: "/links", target: pollUri, collection: "app.reddwarf.poll.vote.c", path: ".subject.uri", + method: "/links", + target: pollUri, + collection: "app.reddwarf.poll.vote.c", + path: ".subject.uri", + customkey: "constellation-polls", }); const { data: votersD } = useQueryConstellation({ - method: "/links", target: pollUri, collection: "app.reddwarf.poll.vote.d", path: ".subject.uri", + method: "/links", + target: pollUri, + collection: "app.reddwarf.poll.vote.d", + path: ".subject.uri", + customkey: "constellation-polls", }); // --- 2. Prepare Data --- @@ -2226,7 +2248,7 @@ pollUri, pollRecord?.cid, !!poll.multiple, - serverCounts + serverCounts, ); // --- 4. Render --- @@ -2366,36 +2388,59 @@ )} {poll.multiple ? "Select one or more options" : "Select one option"} + + {/* Refresh Button */} + {/* Options List with Results */}
{options.map((optionText, index) => { - const optionKey = ["a", "b", "c", "d"][index] as "a" | "b" | "c" | "d"; + const optionKey = ["a", "b", "c", "d"][index] as + | "a" + | "b" + | "c" + | "d"; const { topVoterDids } = results[optionKey]; const optionState = results[optionKey]; const hasVotedForOption = optionState.hasVoted; - const votePercentage = totalVotes > 0 ? (optionState.count / totalVotes) * 100 : 0; + const votePercentage = + totalVotes > 0 ? (optionState.count / totalVotes) * 100 : 0; // Helper to get voters for avatars const votersData = (() => { - if (optionKey === 'a') return votersA?.linking_records || []; - if (optionKey === 'b') return votersB?.linking_records || []; - if (optionKey === 'c') return votersC?.linking_records || []; - if (optionKey === 'd') return votersD?.linking_records || []; + if (optionKey === "a") return votersA?.linking_records || []; + if (optionKey === "b") return votersB?.linking_records || []; + if (optionKey === "c") return votersC?.linking_records || []; + if (optionKey === "d") return votersD?.linking_records || []; return []; })(); - const topVoters = votersData.filter((v: any) => !!v.did).slice(0, 5); + const topVoters = votersData + .filter((v: any) => !!v.did) + .slice(0, 5); return (
{ e.stopPropagation(); if (!isExpired) { @@ -2423,18 +2468,18 @@
{/* Avatar circles - semi overlapping */} {topVoterDids.length > 0 && ( -
- {topVoterDids.map((did, idx) => ( -
- -
- ))} -
- )} +
+ {topVoterDids.map((did, idx) => ( +
+ +
+ ))} +
+ )} {/* Vote count */} @@ -2846,10 +2891,10 @@ width: "100%", aspectRatio: image.aspectRatio ? (() => { - const { width, height } = image.aspectRatio; - const ratio = width / height; - return ratio < 0.5 ? "1 / 2" : `${width} / ${height}`; - })() + const { width, height } = image.aspectRatio; + const ratio = width / height; + return ratio < 0.5 ? "1 / 2" : `${width} / ${height}`; + })() : "1 / 1", // fallback to square //backgroundColor: theme.background, // fallback letterboxing color borderRadius: 12, @@ -3547,8 +3592,9 @@ borderRadius: 12, overflow: "hidden", //border: `1px solid ${theme.border}`, - paddingTop: `${100 / (aspect ? aspect.width / aspect.height : 16 / 9) - }%`, // 16:9 = 56.25%, 4:3 = 75% + paddingTop: `${ + 100 / (aspect ? aspect.width / aspect.height : 16 / 9) + }%`, // 16:9 = 56.25%, 4:3 = 75% }} className="border border-gray-200 dark:border-gray-800 was7" > diff --git a/src/providers/PollMutationQueueProvider.tsx b/src/providers/PollMutationQueueProvider.tsx --- a/src/providers/PollMutationQueueProvider.tsx +++ b/src/providers/PollMutationQueueProvider.tsx @@ -1,3 +1,4 @@ +import { useQueryClient } from "@tanstack/react-query"; import { useAtom } from "jotai"; import React, { createContext, use, useCallback, useMemo } from "react"; @@ -27,6 +28,7 @@ ) => Promise; getLocalVotes: (pollUri: string) => ExtendedLocalVote[]; + refreshPollData: (pollUri?: string) => void; } const PollMutationContext = createContext( @@ -43,6 +45,7 @@ children: React.ReactNode; }) { const { agent } = useAuth(); + const queryClient = useQueryClient(); const [localVotes, setLocalVotes] = useAtom(localPollVotesAtom); const getLocalVotes = useCallback( @@ -53,13 +56,51 @@ ); const updateLocalState = useCallback( - (pollUri: string, updater: (prev: ExtendedLocalVote[]) => ExtendedLocalVote[]) => { + ( + pollUri: string, + updater: (prev: ExtendedLocalVote[]) => ExtendedLocalVote[], + ) => { setLocalVotes((prev) => ({ ...prev, [pollUri]: updater((prev[pollUri] || []) as ExtendedLocalVote[]), })); }, [setLocalVotes], + ); + + const refreshPollData = useCallback( + (pollUri?: string) => { + // Clear all local pending votes for this poll or all polls + if (pollUri) { + // Clear local state for specific poll + setLocalVotes((prev) => { + const newState = { ...prev }; + delete newState[pollUri]; + return newState; + }); + } else { + // Clear all local votes + setLocalVotes({}); + } + + // Invalidate all poll constellation queries using predicate function + queryClient.invalidateQueries({ + predicate: (query) => { + const queryKey = query.queryKey; + return ( + Array.isArray(queryKey) && queryKey.includes("constellation-polls") + ); + }, + }); + + // If specific poll URI provided, also invalidate that poll's data + if (pollUri) { + queryClient.invalidateQueries({ + queryKey: ["arbitrary", pollUri], + }); + } + }, + [queryClient, setLocalVotes], ); const castVoteRaw = useCallback( @@ -81,7 +122,7 @@ // Check if ANY server vote exists for this option const hasServerVote = currentServerVotes.some((uri) => - uri.includes(`app.reddwarf.poll.vote.${optionKey}`) + uri.includes(`app.reddwarf.poll.vote.${optionKey}`), ); const isCurrentlyVoted = localEntry @@ -92,24 +133,26 @@ // ACTION: UNVOTE (Toggle Off) // ------------------------------------------------------------ if (isCurrentlyVoted) { - // Optimistic Update: Tombstone updateLocalState(pollUri, (prev) => { - const clean = prev.filter(v => v.option !== optionKey); - return [...clean, { - pollUri, - option: optionKey, - status: "pending", - action: "delete", - timestamp - }]; + const clean = prev.filter((v) => v.option !== optionKey); + return [ + ...clean, + { + pollUri, + option: optionKey, + status: "pending", + action: "delete", + timestamp, + }, + ]; }); try { // FIX: Collect ALL URIs for this option (Server + Local) // We want to nuke every record that matches this option to clean up state - const serverUris = currentServerVotes.filter(uri => - uri.includes(`app.reddwarf.poll.vote.${optionKey}`) + const serverUris = currentServerVotes.filter((uri) => + uri.includes(`app.reddwarf.poll.vote.${optionKey}`), ); const urisToDelete = [...serverUris]; @@ -122,7 +165,7 @@ // Parallel delete for everything found await Promise.all( - uniqueUris.map(uri => { + uniqueUris.map((uri) => { const match = uri.match(/at:\/\/(.+)\/(.+)\/(.+)/); if (!match) return Promise.resolve(); const [, repo, collection, rkey] = match; @@ -131,14 +174,15 @@ collection, rkey, }); - }) + }), ); - } catch (e) { console.error("Failed to unvote", e); renderSnack({ title: "Failed to remove vote" }); // Revert optimistic update - updateLocalState(pollUri, (prev) => prev.filter(v => v.timestamp !== timestamp)); + updateLocalState(pollUri, (prev) => + prev.filter((v) => v.timestamp !== timestamp), + ); } } @@ -146,26 +190,33 @@ // ACTION: VOTE (Toggle On) // ------------------------------------------------------------ else { - // ... (The Vote logic remains the same, as the Single Choice cleanup + // ... (The Vote logic remains the same, as the Single Choice cleanup // logic there already iterated over the entire array) ... updateLocalState(pollUri, (prev) => { - const newState = isMultiple ? [...prev] : prev.filter(v => v.action !== 'create'); - const clean = newState.filter(v => v.option !== optionKey); - return [...clean, { - pollUri, - option: optionKey, - status: "pending", - action: "create", - timestamp - }]; + const newState = isMultiple + ? [...prev] + : prev.filter((v) => v.action !== "create"); + const clean = newState.filter((v) => v.option !== optionKey); + return [ + ...clean, + { + pollUri, + option: optionKey, + status: "pending", + action: "create", + timestamp, + }, + ]; }); // Cleanup others if single choice if (!isMultiple) { const votesToDelete = [ ...currentServerVotes, - ...(currentLocal.filter(v => v.action === 'create' && v.uri).map(v => v.uri) as string[]) + ...(currentLocal + .filter((v) => v.action === "create" && v.uri) + .map((v) => v.uri) as string[]), ]; // This was already safe because it iterates the whole array @@ -174,7 +225,9 @@ const match = voteUri.match(/at:\/\/(.+)\/(.+)\/(.+)/); if (match) { const [, repo, collection, rkey] = match; - agent.com.atproto.repo.deleteRecord({ repo, collection, rkey }).catch(console.error); + agent.com.atproto.repo + .deleteRecord({ repo, collection, rkey }) + .catch(console.error); } }); } @@ -192,20 +245,25 @@ }); updateLocalState(pollUri, (prev) => { - const clean = prev.filter(v => v.option !== optionKey); - return [...clean, { - pollUri, - option: optionKey, - status: "confirmed", - action: "create", - uri: res.data.uri, - timestamp: Date.now(), - }]; + const clean = prev.filter((v) => v.option !== optionKey); + return [ + ...clean, + { + pollUri, + option: optionKey, + status: "confirmed", + action: "create", + uri: res.data.uri, + timestamp: Date.now(), + }, + ]; }); } catch (e) { console.error("Vote failed", e); renderSnack({ title: "Vote failed" }); - updateLocalState(pollUri, (prev) => prev.filter(v => v.timestamp !== timestamp)); + updateLocalState(pollUri, (prev) => + prev.filter((v) => v.timestamp !== timestamp), + ); } } }, @@ -213,7 +271,9 @@ ); return ( - + {children} ); @@ -234,16 +294,44 @@ const agentDid = agent?.did; const userVotesA = useGetOneToOneState( - agentDid ? { target: pollUri, user: agentDid, collection: "app.reddwarf.poll.vote.a", path: ".subject.uri" } : undefined + agentDid + ? { + target: pollUri, + user: agentDid, + collection: "app.reddwarf.poll.vote.a", + path: ".subject.uri", + } + : undefined, ); const userVotesB = useGetOneToOneState( - agentDid ? { target: pollUri, user: agentDid, collection: "app.reddwarf.poll.vote.b", path: ".subject.uri" } : undefined + agentDid + ? { + target: pollUri, + user: agentDid, + collection: "app.reddwarf.poll.vote.b", + path: ".subject.uri", + } + : undefined, ); const userVotesC = useGetOneToOneState( - agentDid ? { target: pollUri, user: agentDid, collection: "app.reddwarf.poll.vote.c", path: ".subject.uri" } : undefined + agentDid + ? { + target: pollUri, + user: agentDid, + collection: "app.reddwarf.poll.vote.c", + path: ".subject.uri", + } + : undefined, ); const userVotesD = useGetOneToOneState( - agentDid ? { target: pollUri, user: agentDid, collection: "app.reddwarf.poll.vote.d", path: ".subject.uri" } : undefined + agentDid + ? { + target: pollUri, + user: agentDid, + collection: "app.reddwarf.poll.vote.d", + path: ".subject.uri", + } + : undefined, ); return useMemo(() => { @@ -273,22 +361,41 @@ // 1. FETCHING - Move the logic here // We only need the first page/subset to show avatars const { data: votersA } = useQueryConstellation({ - method: "/links", target: pollUri, collection: "app.reddwarf.poll.vote.a", path: ".subject.uri", + method: "/links", + target: pollUri, + collection: "app.reddwarf.poll.vote.a", + path: ".subject.uri", + customkey: "constellation-polls", }); const { data: votersB } = useQueryConstellation({ - method: "/links", target: pollUri, collection: "app.reddwarf.poll.vote.b", path: ".subject.uri", + method: "/links", + target: pollUri, + collection: "app.reddwarf.poll.vote.b", + path: ".subject.uri", + customkey: "constellation-polls", }); const { data: votersC } = useQueryConstellation({ - method: "/links", target: pollUri, collection: "app.reddwarf.poll.vote.c", path: ".subject.uri", + method: "/links", + target: pollUri, + collection: "app.reddwarf.poll.vote.c", + path: ".subject.uri", + customkey: "constellation-polls", }); const { data: votersD } = useQueryConstellation({ - method: "/links", target: pollUri, collection: "app.reddwarf.poll.vote.d", path: ".subject.uri", + method: "/links", + target: pollUri, + collection: "app.reddwarf.poll.vote.d", + path: ".subject.uri", + customkey: "constellation-polls", }); - const handleVote = useCallback((optionKey: string) => { - if (!pollCid) return; - castVoteRaw(pollUri, pollCid, optionKey, isMultiple, serverUserVotes); - }, [pollUri, pollCid, isMultiple, serverUserVotes, castVoteRaw]); + const handleVote = useCallback( + (optionKey: string) => { + if (!pollCid) return; + castVoteRaw(pollUri, pollCid, optionKey, isMultiple, serverUserVotes); + }, + [pollUri, pollCid, isMultiple, serverUserVotes, castVoteRaw], + ); return useMemo(() => { // Helper to clean a raw list: extract DIDs, Deduplicate, Remove Self @@ -314,7 +421,7 @@ // --- LOGIC: Determine if we have voted (Boolean) --- const localEntry = localVotes.find((v) => v.option === option); const isServerVoted = serverUserVotes.some((uri) => - uri.includes(`app.reddwarf.poll.vote.${option}`) + uri.includes(`app.reddwarf.poll.vote.${option}`), ); let hasVoted = false; @@ -326,7 +433,9 @@ hasVoted = isServerVoted; } else { // Single choice: if we created a vote elsewhere locally, this one is false - const hasSwitched = localVotes.some((v) => v.option !== option && v.action === "create"); + const hasSwitched = localVotes.some( + (v) => v.option !== option && v.action === "create", + ); hasVoted = hasSwitched ? false : isServerVoted; } } @@ -348,7 +457,7 @@ hasVoted, count, // We only return the DIDs now, top 5 - topVoterDids: finalVoters.slice(0, 5) + topVoterDids: finalVoters.slice(0, 5), }; }; @@ -359,7 +468,11 @@ return { results: { a: stateA, b: stateB, c: stateC, d: stateD }, - hasVotedAny: stateA.hasVoted || stateB.hasVoted || stateC.hasVoted || stateD.hasVoted, + hasVotedAny: + stateA.hasVoted || + stateB.hasVoted || + stateC.hasVoted || + stateD.hasVoted, totalVotes: stateA.count + stateB.count + stateC.count + stateD.count, handleVote, }; @@ -367,9 +480,12 @@ localVotes, serverUserVotes, serverCounts, - votersA, votersB, votersC, votersD, // Dependencies for fetching + votersA, + votersB, + votersC, + votersD, // Dependencies for fetching isMultiple, handleVote, myDid, ]); -} \ No newline at end of file +} diff --git a/src/utils/followState.ts b/src/utils/followState.ts --- a/src/utils/followState.ts +++ b/src/utils/followState.ts @@ -1,8 +1,8 @@ -import { type Agent,AtUri } from "@atproto/api"; +import { type Agent, AtUri } from "@atproto/api"; import { TID } from "@atproto/common-web"; import type { QueryClient } from "@tanstack/react-query"; -import { type linksRecordsResponse,useQueryConstellation } from "./useQuery"; +import { type linksRecordsResponse, useQueryConstellation } from "./useQuery"; export function useGetFollowState({ target, @@ -21,7 +21,7 @@ path: ".subject", dids: [user], } - : { method: "undefined", target: "whatever" } + : { method: "undefined", target: "whatever" }, // overloading sucks so much ) as { data: linksRecordsResponse | undefined }; const follows = followData?.linking_records.slice(0, 50) ?? []; @@ -60,12 +60,12 @@ const updateCache = ( updater: ( - oldData: linksRecordsResponse | undefined - ) => linksRecordsResponse | undefined + oldData: linksRecordsResponse | undefined, + ) => linksRecordsResponse | undefined, ) => { queryClient.setQueryData( queryKey, - (oldData: linksRecordsResponse | undefined) => updater(oldData) + (oldData: linksRecordsResponse | undefined) => updater(oldData), ); }; @@ -122,14 +122,12 @@ linking_records: old.linking_records.filter( (rec) => !followRecords.includes( - `at://${rec.did}/${rec.collection}/${rec.rkey}` - ) + `at://${rec.did}/${rec.collection}/${rec.rkey}`, + ), ), }; }); } - - export function useGetOneToOneState(params?: { target: string; @@ -146,8 +144,12 @@ collection: params.collection, path: params.path, dids: [params.user], + // todo disgusting hack please never code again + customkey: params.collection.includes("reddwarf.poll.vote") + ? "constellation-polls" + : undefined, } - : { method: "undefined", target: "whatever" } + : { method: "undefined", target: "whatever" }, // overloading sucks so much ) as { data: linksRecordsResponse | undefined }; if (!params || !params.user) return undefined; @@ -160,4 +162,4 @@ } return undefined; -} \ No newline at end of file +} diff --git a/src/utils/useQuery.ts b/src/utils/useQuery.ts --- a/src/utils/useQuery.ts +++ b/src/utils/useQuery.ts @@ -239,6 +239,7 @@ path?: string; cursor?: string; dids?: string[]; + customkey?: string; }) { // : QueryOptions< // | linksRecordsResponse @@ -257,6 +258,7 @@ query?.path, query?.cursor, query?.dids, + query?.customkey, ] as const, queryFn: async () => { if (!query || query.method === "undefined") return undefined as undefined; @@ -322,6 +324,7 @@ path: string; cursor?: string; dids?: string[]; + customkey?: string; }): UseQueryResult; export function useQueryConstellation(query: { method: "/links/distinct-dids"; @@ -329,6 +332,7 @@ collection: string; path: string; cursor?: string; + customkey?: string; }): UseQueryResult; export function useQueryConstellation(query: { method: "/links/count"; @@ -336,6 +340,7 @@ collection: string; path: string; cursor?: string; + customkey?: string; }): UseQueryResult; export function useQueryConstellation(query: { method: "/links/count/distinct-dids"; @@ -343,15 +348,18 @@ collection: string; path: string; cursor?: string; + customkey?: string; }): UseQueryResult; export function useQueryConstellation(query: { method: "/links/all"; target: string; + customkey?: string; }): UseQueryResult; export function useQueryConstellation(): undefined; export function useQueryConstellation(query: { method: "undefined"; target: string; + customkey?: string; }): undefined; export function useQueryConstellation(query?: { method: @@ -366,6 +374,7 @@ path?: string; cursor?: string; dids?: string[]; + customkey?: string; }): | UseQueryResult< | linksRecordsResponse -- tangled.sh