mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-02 10:41:54 +02:00
🐛 Fix double render for subscribed users (#877)
This commit is contained in:
parent
f64f9e9539
commit
0341f3a09b
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue