diff --git a/apps/desktop/src/auth/useConnections.ts b/apps/desktop/src/auth/useConnections.ts
index eefeccd96f..aa6fab2d7e 100644
--- a/apps/desktop/src/auth/useConnections.ts
+++ b/apps/desktop/src/auth/useConnections.ts
@@ -7,7 +7,7 @@ import { useAuth } from "./context";
import { env } from "~/env";
-export function useConnections() {
+export function useConnections({ enabled = true }: { enabled?: boolean } = {}) {
const auth = useAuth();
const userId = auth?.session?.user.id;
@@ -25,6 +25,6 @@ export function useConnections() {
}
return data?.connections ?? [];
},
- enabled: !!userId,
+ enabled: !!userId && enabled,
});
}
diff --git a/apps/desktop/src/calendar/components/oauth/provider-content.tsx b/apps/desktop/src/calendar/components/oauth/provider-content.tsx
index f8cd0936b0..cb6334e5c3 100644
--- a/apps/desktop/src/calendar/components/oauth/provider-content.tsx
+++ b/apps/desktop/src/calendar/components/oauth/provider-content.tsx
@@ -13,11 +13,15 @@ import { useBillingAccess } from "~/auth/billing";
import { useConnections } from "~/auth/useConnections";
import type { CalendarProvider } from "~/calendar/components/shared";
import { buildWebAppUrl } from "~/shared/utils";
+import { useTabs } from "~/store/zustand/tabs";
export function OAuthProviderContent({ config }: { config: CalendarProvider }) {
const auth = useAuth();
const billing = useBillingAccess();
- const { data: connections, isError } = useConnections();
+ const openNew = useTabs((state) => state.openNew);
+ const { data: connections, isError } = useConnections({
+ enabled: billing.isPro,
+ });
const connection = connections?.find(
(c) => c.integration_id === config.nangoIntegrationId,
);
@@ -118,16 +122,6 @@ export function OAuthProviderContent({ config }: { config: CalendarProvider }) {
);
}
- if (isError) {
- return (
-
-
- Failed to load integration status
-
-
- );
- }
-
if (!auth.session) {
const connectButton = (