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.
This commit is contained in:
Anik Dhabal Babu authored and GitHub committed 2025-12-23 16:49:34 +00:00
1 parent efcf68869d
commit 2689cdfdff
3 files changed
+15 -4

No files matched your search

+2 -2
View File
@@ -2,13 +2,13 @@ import { useSession } from "next-auth/react";
import { trpc } from "@calcom/trpc/react";
export default function useApp(appId: string) {
export default function useApp(appId: string, options?: { enabled?: boolean }) {
const { status } = useSession();
return trpc.viewer.apps.appById.useQuery(
{ appId },
{
enabled: status === "authenticated",
enabled: status === "authenticated" && (options?.enabled ?? true),
}
);
}