Live video on the AT Protocol

switch to AppBskyActorDefs.ProfileViewDetailed

+11 -8
+9 -6
js/components/src/context/profile-cache.tsx
··· 1 - import { ProfileViewDetailed } from "@atproto/api/dist/client/types/app/bsky/actor/defs"; 1 + import { AppBskyActorDefs } from "@atproto/api"; 2 2 import { 3 3 createContext, 4 4 useCallback, ··· 9 9 import { useUnauthenticatedBlueskyAppViewAgent } from "../streamplace-store"; 10 10 11 11 interface ProfileCacheContextValue { 12 - profiles: Record<string, ProfileViewDetailed>; 12 + profiles: Record<string, AppBskyActorDefs.ProfileViewDetailed>; 13 13 requestProfiles: (dids: string[]) => void; 14 14 } 15 15 ··· 22 22 children: React.ReactNode; 23 23 }) { 24 24 const agent = useUnauthenticatedBlueskyAppViewAgent(); 25 - const [profiles, setProfiles] = useState<Record<string, ProfileViewDetailed>>( 26 - {}, 27 - ); 25 + const [profiles, setProfiles] = useState< 26 + Record<string, AppBskyActorDefs.ProfileViewDetailed> 27 + >({}); 28 28 const agentRef = useRef(agent); 29 29 agentRef.current = agent; 30 30 const profilesRef = useRef(profiles); ··· 54 54 agentRef.current 55 55 .getProfiles({ actors: toFetch }) 56 56 .then((result) => { 57 - const newProfiles: Record<string, ProfileViewDetailed> = {}; 57 + const newProfiles: Record< 58 + string, 59 + AppBskyActorDefs.ProfileViewDetailed 60 + > = {}; 58 61 result.data.profiles.forEach((p) => { 59 62 newProfiles[p.did] = p; 60 63 });
+2 -2
js/components/src/hooks/useAvatars.tsx
··· 1 - import { ProfileViewDetailed } from "@atproto/api/dist/client/types/app/bsky/actor/defs"; 1 + import { AppBskyActorDefs } from "@atproto/api"; 2 2 import { useEffect, useMemo } from "react"; 3 3 import { useProfileCache } from "../context/profile-cache"; 4 4 5 5 export function useAvatars( 6 6 dids: string[], 7 - ): Record<string, ProfileViewDetailed> { 7 + ): Record<string, AppBskyActorDefs.ProfileViewDetailed> { 8 8 const { profiles, requestProfiles } = useProfileCache(); 9 9 10 10 useEffect(() => {