From 5ffaeeb7019f94d662a0e33eae42a01f302c7912 Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Thu, 22 Sep 2022 12:59:23 +0800 Subject: [PATCH] feat: no limit display --- src/app/config.ts | 9 +++++---- src/common/hook/useLicense.ts | 2 +- src/routes/setting/License.tsx | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/app/config.ts b/src/app/config.ts index 42a6373c..434d558a 100644 --- a/src/app/config.ts +++ b/src/app/config.ts @@ -13,7 +13,7 @@ export const LicensePriceList = [ { title: "VoceChat Supreme", limit: 99999, - pid: "price_1LkKqdGGoUDRyc3jnpZvXhzx", + pid: "price_1Lkgc7GGoUDRyc3j49Lqtncs", desc: "User Limit: No Limit" } // { @@ -24,9 +24,10 @@ export const LicensePriceList = [ // desc: "User Limit: 500" // } ]; -export const PAYMENT_URL_PREFIX = process.env.REACT_APP_RELEASE - ? `https://vera.nicegoodthings.com` - : `http://localhost:4000`; +export const PAYMENT_URL_PREFIX = + process.env.NODE_ENV === "production" + ? `https://vera.nicegoodthings.com` + : `http://localhost:4000`; export const CACHE_VERSION = `0.3.1`; export const GuestRoutes = ["/", "/chat", "/chat/channel/:channel_id"]; export const ContentTypes = { diff --git a/src/common/hook/useLicense.ts b/src/common/hook/useLicense.ts index 8c090b96..c700f7b8 100644 --- a/src/common/hook/useLicense.ts +++ b/src/common/hook/useLicense.ts @@ -8,7 +8,7 @@ import { useAppSelector } from "../../app/store"; const useLicense = () => { const userCount = useAppSelector((store) => store.users.ids.length); - const { data: license } = useGetLicenseQuery(); + const { data: license } = useGetLicenseQuery(undefined, { refetchOnMountOrArgChange: true }); const [check, { isLoading: isChecking, isSuccess: checked }] = useCheckLicenseMutation(); const [upsert, { isSuccess: upserted, isLoading: upserting }] = useUpsertLicenseMutation(); const checkLicense = (l: string) => { diff --git a/src/routes/setting/License.tsx b/src/routes/setting/License.tsx index b9860d68..bc0c3c6b 100644 --- a/src/routes/setting/License.tsx +++ b/src/routes/setting/License.tsx @@ -84,7 +84,9 @@ export default function License() {
User Limit - {licenseInfo?.user_limit} + + {licenseInfo?.user_limit == 99999 ? "No Limit" : licenseInfo?.user_limit} +
Expired At