Files
discord-decomp/modules/user_profile/hooks/useUserProfileConnections.tsx
T
2026-11-01 12:12:55 +02:00

18 lines
892 B
TypeScript

// Metro module 12190 (f12191).
import { useMemo } from "react";
import UserProfileStore from "../UserProfileStore";
import { usePlatformAllowed } from "../../connections/ConnectionsHooks";
import { useStateFromStores } from "../../../_bundle/Module589";
import Platforms from "../../../lib/Platforms";
let c8420_5 = [];
export default function useUserProfileConnections(c19716_0) {
const platformAllowed = usePlatformAllowed({
forUserProfile: true
});
const stateFromStores = useStateFromStores([UserProfileStore], () => UserProfileStore.getUserProfile(c19716_0));
return useMemo(() => stateFromStores?.connectedAccounts == null ? c8420_5 : stateFromStores.connectedAccounts.filter(({ type }) => {
const r10 = Platforms.get(type);
return r10 != null && Platforms.isSupported(type) && platformAllowed(r10);
}), [stateFromStores?.connectedAccounts, platformAllowed]);
};