From 8adb720a804698d70a62d5bfc709ce44fb61c0f9 Mon Sep 17 00:00:00 2001 From: Amit Sharma <74371312+Amit91848@users.noreply.github.com> Date: Mon, 23 Jun 2025 03:54:16 +0530 Subject: [PATCH] fix: Double skeleton apps page (#21965) --- packages/app-store/components.tsx | 44 ++----------------------------- 1 file changed, 2 insertions(+), 42 deletions(-) diff --git a/packages/app-store/components.tsx b/packages/app-store/components.tsx index 79187279cf..ec99ba3028 100644 --- a/packages/app-store/components.tsx +++ b/packages/app-store/components.tsx @@ -1,20 +1,16 @@ "use client"; import Link from "next/link"; -import { useRouter } from "next/navigation"; -import { useEffect, useRef } from "react"; import type { UseAddAppMutationOptions } from "@calcom/app-store/_utils/useAddAppMutation"; import useAddAppMutation from "@calcom/app-store/_utils/useAddAppMutation"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { deriveAppDictKeyFromType } from "@calcom/lib/deriveAppDictKeyFromType"; -import { useHasTeamPlan } from "@calcom/lib/hooks/useHasPaidPlan"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { trpc } from "@calcom/trpc/react"; import type { RouterOutputs } from "@calcom/trpc/react"; import type { App } from "@calcom/types/App"; -import { Icon } from "@calcom/ui/components/icon"; import classNames from "@calcom/ui/classNames"; +import { Icon } from "@calcom/ui/components/icon"; import { InstallAppButtonMap } from "./apps.browser.generated"; import type { InstallAppButtonProps } from "./types"; @@ -59,44 +55,8 @@ export const InstallAppButton = ( disableInstall?: boolean; } & InstallAppButtonProps ) => { - const { isPending: isUserLoading, data: user } = trpc.viewer.me.get.useQuery(); - const router = useRouter(); - const proProtectionElementRef = useRef(null); - const { isPending: isTeamPlanStatusLoading, hasTeamPlan } = useHasTeamPlan(); - - useEffect(() => { - const el = proProtectionElementRef.current; - if (!el) { - return; - } - el.addEventListener( - "click", - (e) => { - if (!user) { - router.push( - `${WEBAPP_URL}/auth/login?callbackUrl=${WEBAPP_URL + location.pathname + location.search}` - ); - e.stopPropagation(); - return; - } - - if (props.teamsPlanRequired && !hasTeamPlan) { - // TODO: I think we should show the UpgradeTip in a Dialog here. This would solve the problem of no way to go back to the App page from the UpgradeTip page(except browser's back button) - router.push(props.teamsPlanRequired.upgradeUrl); - e.stopPropagation(); - return; - } - }, - true - ); - }, [isUserLoading, user, router, hasTeamPlan, props.teamsPlanRequired]); - - if (isUserLoading || isTeamPlanStatusLoading) { - return null; - } - return ( -
+
);