Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
fix: Separate vite and next plan util
Richie McIlroyb3f4d0be15d3
diff --git a/apps/desktop/src/routes/(window-chrome)/upgrade.tsx b/apps/desktop/src/routes/(window-chrome)/upgrade.tsxindex 4fd75afc4..65f1f8ca0 100644--- a/apps/desktop/src/routes/(window-chrome)/upgrade.tsx+++ b/apps/desktop/src/routes/(window-chrome)/upgrade.tsx@@ -1,5 +1,5 @@import { createSignal, onCleanup, onMount } from "solid-js";-import { getProPlanId } from "@cap/utils";+import { getProPlanId } from "~/utils/plans";import { commands } from "~/utils/tauri";import { clientEnv } from "~/utils/env";import { authStore } from "../../store";diff --git a/apps/desktop/src/utils/plans.ts b/apps/desktop/src/utils/plans.tsnew file mode 100644index 000000000..dec332013--- /dev/null+++ b/apps/desktop/src/utils/plans.ts@@ -0,0 +1,32 @@+const planIds = {+ development: {+ yearly: "price_1Q3esrFJxA1XpeSsFwp486RN",+ monthly: "price_1P9C1DFJxA1XpeSsTwwuddnq",+ },+ production: {+ yearly: "price_1Q29mcFJxA1XpeSsbti0xJpZ",+ monthly: "price_1OtBMeFJxA1XpeSsfOu2SKp1",+ },+};++export const getProPlanId = (billingCycle: "yearly" | "monthly") => {+ const environment = import.meta.env.VITE_ENVIRONMENT === "development" ? "development" : "production";+ return planIds[environment]?.[billingCycle] || "";+};++export const isUserOnProPlan = ({+ subscriptionStatus,+}: {+ subscriptionStatus: string;+}) => {+ if (+ subscriptionStatus === "active" ||+ subscriptionStatus === "trialing" ||+ subscriptionStatus === "complete" ||+ subscriptionStatus === "paid"+ ) {+ return true;+ }++ return false;+};\ No newline at end of filediff --git a/packages/utils/src/constants/plans.ts b/packages/utils/src/constants/plans.tsindex 625e056e1..48569a46e 100644--- a/packages/utils/src/constants/plans.ts+++ b/packages/utils/src/constants/plans.ts@@ -10,10 +10,7 @@ const planIds = {};export const getProPlanId = (billingCycle: "yearly" | "monthly") => {- const value =- typeof import.meta !== 'undefined' && typeof import.meta.env !== 'undefined'- ? import.meta.env.VITE_ENVIRONMENT- : process.env.NEXT_PUBLIC_ENVIRONMENT;+ const value = process.env.NEXT_PUBLIC_ENVIRONMENT;const environment = value === "development" ? "development" : "production";return planIds[environment]?.[billingCycle] || "";