fix: client locale inference (#10850)

This commit is contained in:
Omar López authored and GitHub committed 2023-08-22 14:34:55 +02:00
1 parent bbad0fbc18
commit 6743aa4609
16 files changed
+102 -127

No files matched your search

+2 -6
View File
@@ -1,16 +1,12 @@
import Link from "next/link";
import { useEffect, useState } from "react";
import { COMPANY_NAME, IS_SELF_HOSTED, IS_CALCOM } from "@calcom/lib/constants";
// Relative to prevent triggering a recompile
import pkg from "../../../../apps/web/package.json";
import { CALCOM_VERSION, COMPANY_NAME, IS_CALCOM, IS_SELF_HOSTED } from "@calcom/lib/constants";
// eslint-disable-next-line turbo/no-undeclared-env-vars
const vercelCommitHash = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
const commitHash = vercelCommitHash ? `-${vercelCommitHash.slice(0, 7)}` : "";
export const CalComVersion = `v.${pkg.version}-${!IS_SELF_HOSTED ? "h" : "sh"}`;
const CalComVersion = `v.${CALCOM_VERSION}-${!IS_SELF_HOSTED ? "h" : "sh"}`;
export default function Credits() {
const [hasMounted, setHasMounted] = useState(false);
@@ -4,11 +4,11 @@ import { vi } from "vitest";
import Credits from "./Credits";
vi.mock("../../../../apps/web/package.json", async () => {
vi.mock("@calcom/lib/constants", async () => {
const actual = (await vi.importActual("@calcom/lib/constants")) as typeof import("@calcom/lib/constants");
return {
default: {
version: "mockedVersion",
},
...actual,
CALCOM_VERSION: "mockedVersion",
};
});