* perf: pass app data to OmniInstallAppButton to avoid redundant API calls * Clean up comments in OmniInstallAppButton component Removed comment about pre-fetched app data and fetching logic.
15 lines
359 B
TypeScript
15 lines
359 B
TypeScript
import { useSession } from "next-auth/react";
|
|
|
|
import { trpc } from "@calcom/trpc/react";
|
|
|
|
export default function useApp(appId: string, options?: { enabled?: boolean }) {
|
|
const { status } = useSession();
|
|
|
|
return trpc.viewer.apps.appById.useQuery(
|
|
{ appId },
|
|
{
|
|
enabled: status === "authenticated" && (options?.enabled ?? true),
|
|
}
|
|
);
|
|
}
|