Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Fix double render for subscribed users (#877)

Luke Vella0341f3a09b8d
diff --git a/apps/web/src/components/user-provider.tsx b/apps/web/src/components/user-provider.tsx
index a2298d660..7cf78630b 100644
--- a/apps/web/src/components/user-provider.tsx
+++ b/apps/web/src/components/user-provider.tsx
@@ -4,6 +4,7 @@ import React from "react";
import { PostHogProvider } from "@/contexts/posthog";
import { useWhoAmI } from "@/contexts/whoami";
+import { isSelfHosted } from "@/utils/constants";
import { useRequiredContext } from "./use-required-context";
@@ -52,6 +53,11 @@ export const UserProvider = (props: { children?: React.ReactNode }) => {
const user = useWhoAmI();
const { data: userPreferences } = trpc.userPreferences.get.useQuery();
+ // TODO (Luke Vella) [2023-09-19]: Remove this when we have a better way to query for an active subscription
+ trpc.user.subscription.useQuery(undefined, {
+ enabled: !isSelfHosted,
+ });
+
const name = user
? user.isGuest === false
? user.name