Files
calendar/packages/features/apps/hooks/useApp.ts
T
Anik Dhabal BabuandGitHub 2689cdfdff perf: pass app data to OmniInstallAppButton to avoid redundant API calls (#26156)
* 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.
2025-12-23 16:49:34 +00:00

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),
}
);
}