Skip to content

Fixed v2 usage meter displaying when on paid plan #1255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions apps/webapp/app/components/navigation/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ import {
PopoverSectionHeader,
} from "../primitives/Popover";
import { StepNumber } from "../primitives/StepNumber";
import { TextLink } from "../primitives/TextLink";
import { SideMenuHeader } from "./SideMenuHeader";
import { SideMenuItem } from "./SideMenuItem";
import { TextLink } from "../primitives/TextLink";

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

const isV3Project = project.version === "V3";
const isFreeV3User = currentPlan?.v3Subscription?.isPaying === false;

useEffect(() => {
const handleScroll = () => {
if (borderRef.current) {
Expand Down Expand Up @@ -334,7 +337,7 @@ export function SideMenu({ user, project, organization, organizations }: SideMen
</Button>
}
/>
{currentPlan?.v3Subscription?.isPaying === false && (
{isV3Project && isFreeV3User && (
<FreePlanUsage
to={v3BillingPath(organization)}
percentage={currentPlan.v3Usage.usagePercentage}
Expand Down
Loading