Skip to content

Commit 07054f1

Browse files
authored
Fixed v2 usage meter displaying when on paid plan (#1255)
* Fixed v2 usage meter displaying when on paid plan * Show the free usage panel only for v3 projects
1 parent c50a94b commit 07054f1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 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,9 @@ export function SideMenu({ user, project, organization, organizations }: SideMen
106106
const currentPlan = useCurrentPlan();
107107
const { isManagedCloud } = useFeatures();
108108

109+
const isV3Project = project.version === "V3";
110+
const isFreeV3User = currentPlan?.v3Subscription?.isPaying === false;
111+
109112
useEffect(() => {
110113
const handleScroll = () => {
111114
if (borderRef.current) {
@@ -334,7 +337,7 @@ export function SideMenu({ user, project, organization, organizations }: SideMen
334337
</Button>
335338
}
336339
/>
337-
{currentPlan?.v3Subscription?.isPaying === false && (
340+
{isV3Project && isFreeV3User && (
338341
<FreePlanUsage
339342
to={v3BillingPath(organization)}
340343
percentage={currentPlan.v3Usage.usagePercentage}

0 commit comments

Comments
 (0)