📈 Improvements to posthog analytics data (#1189)

This commit is contained in:
Luke Vella 2024-07-03 12:09:58 +01:00 committed by GitHub
parent 278713d57f
commit 587e11de17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 93 additions and 80 deletions

View file

@ -3,15 +3,12 @@ import { Badge } from "@rallly/ui/badge";
import React from "react";
import { Trans } from "@/components/trans";
import { useUser } from "@/components/user-provider";
import { isSelfHosted } from "@/utils/constants";
import { trpc } from "@/utils/trpc/client";
export const useSubscription = () => {
const { user } = useUser();
const { data } = trpc.user.subscription.useQuery(undefined, {
enabled: !isSelfHosted && user.isGuest === false,
enabled: !isSelfHosted,
});
if (isSelfHosted) {
@ -20,12 +17,6 @@ export const useSubscription = () => {
};
}
if (user.isGuest) {
return {
active: false,
};
}
return data;
};