Skip to content

Commit 5143562

Browse files
committed
Fixed v2 usage meter displaying when on paid plan
1 parent c50a94b commit 5143562

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

apps/webapp/app/components/navigation/SideMenu.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ import {
7777
PopoverSectionHeader,
7878
} from "../primitives/Popover";
7979
import { StepNumber } from "../primitives/StepNumber";
80+
import { TextLink } from "../primitives/TextLink";
8081
import { SideMenuHeader } from "./SideMenuHeader";
8182
import { SideMenuItem } from "./SideMenuItem";
82-
import { TextLink } from "../primitives/TextLink";
8383

8484
type SideMenuUser = Pick<User, "email" | "admin"> & { isImpersonating: boolean };
8585
type SideMenuProject = Pick<
@@ -106,6 +106,11 @@ export function SideMenu({ user, project, organization, organizations }: SideMen
106106
const currentPlan = useCurrentPlan();
107107
const { isManagedCloud } = useFeatures();
108108

109+
const hasV2Projects = organizations.some((org) =>
110+
org.projects.some((proj) => proj.version === "V2")
111+
);
112+
const isFreeV3User = currentPlan?.v3Subscription?.isPaying === false;
113+
109114
useEffect(() => {
110115
const handleScroll = () => {
111116
if (borderRef.current) {
@@ -334,7 +339,7 @@ export function SideMenu({ user, project, organization, organizations }: SideMen
334339
</Button>
335340
}
336341
/>
337-
{currentPlan?.v3Subscription?.isPaying === false && (
342+
{hasV2Projects && isFreeV3User && (
338343
<FreePlanUsage
339344
to={v3BillingPath(organization)}
340345
percentage={currentPlan.v3Usage.usagePercentage}

0 commit comments

Comments
 (0)