Skip to content

Scheduling infrastructure for absolutely everyone.

- Prefer the implementation in packages/trpc/react/hooks as it's used by most of the codebase (#21468)

devin-ai-integration[bot]da99001a7a37
diff --git a/apps/web/lib/hooks/useCurrentUserId.ts b/apps/web/lib/hooks/useCurrentUserId.ts
index a9023f6369a..298258bce98 100644
--- a/apps/web/lib/hooks/useCurrentUserId.ts
+++ b/apps/web/lib/hooks/useCurrentUserId.ts
@@ -1,4 +1,4 @@
-import useMeQuery from "./useMeQuery";
+import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";
export const useCurrentUserId = () => {
const query = useMeQuery();
diff --git a/apps/web/lib/hooks/useMeQuery.ts b/apps/web/lib/hooks/useMeQuery.ts
deleted file mode 100644
index d32d27ca503..00000000000
--- a/apps/web/lib/hooks/useMeQuery.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { trpc } from "@calcom/trpc/react";
-
-export function useMeQuery() {
- const meQuery = trpc.viewer.me.get.useQuery(undefined, {
- retry(failureCount) {
- return failureCount > 3;
- },
- });
-
- return meQuery;
-}
-
-export default useMeQuery;
diff --git a/apps/web/modules/bookings/views/bookings-listing-view.tsx b/apps/web/modules/bookings/views/bookings-listing-view.tsx
index c74bf84af7f..55431e66c73 100644
--- a/apps/web/modules/bookings/views/bookings-listing-view.tsx
+++ b/apps/web/modules/bookings/views/bookings-listing-view.tsx
@@ -21,14 +21,13 @@ import { useSegments } from "@calcom/features/data-table/hooks/useSegments";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import type { RouterOutputs } from "@calcom/trpc/react";
import { trpc } from "@calcom/trpc/react";
+import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";
import { Alert } from "@calcom/ui/components/alert";
import { EmptyScreen } from "@calcom/ui/components/empty-screen";
import type { HorizontalTabItemProps } from "@calcom/ui/components/navigation";
import { HorizontalTabs } from "@calcom/ui/components/navigation";
import type { VerticalTabItemProps } from "@calcom/ui/components/navigation";
-import useMeQuery from "@lib/hooks/useMeQuery";
-
import BookingListItem from "@components/booking/BookingListItem";
import SkeletonLoader from "@components/booking/SkeletonLoader";
diff --git a/docs/developing/guides/appstore-and-integration/build-a-greeter-app.mdx b/docs/developing/guides/appstore-and-integration/build-a-greeter-app.mdx
index 49b3e98014c..dc6ded5ca91 100644
--- a/docs/developing/guides/appstore-and-integration/build-a-greeter-app.mdx
+++ b/docs/developing/guides/appstore-and-integration/build-a-greeter-app.mdx
@@ -42,7 +42,7 @@ title: "Build a greeter app"
import showToast from "@calcom/lib/notification";
import { Button } from "@calcom/ui/button/Button";
- import useMeQuery from "@lib/hooks/useMeQuery";
+ import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";
export default function GreeterButton() {
const { data: user } = useMeQuery();