diff --git a/apps/client/src/features/page/components/header/page-header-menu.tsx b/apps/client/src/features/page/components/header/page-header-menu.tsx index 5fdfa078..5de80b57 100644 --- a/apps/client/src/features/page/components/header/page-header-menu.tsx +++ b/apps/client/src/features/page/components/header/page-header-menu.tsx @@ -19,7 +19,6 @@ import { getAppUrl } from "@/lib/config.ts"; import { extractPageSlugId } from "@/lib"; import { treeApiAtom } from "@/features/page/tree/atoms/tree-api-atom.ts"; import { useDeletePageModal } from "@/features/page/hooks/use-delete-page-modal.tsx"; -import { boolean } from "zod"; interface PageHeaderMenuProps { readOnly?: boolean; diff --git a/apps/client/src/lib/config.ts b/apps/client/src/lib/config.ts index c7ff5448..33323b0b 100644 --- a/apps/client/src/lib/config.ts +++ b/apps/client/src/lib/config.ts @@ -7,13 +7,11 @@ declare global { export function getAppUrl(): string { let appUrl = window.CONFIG?.APP_URL || process.env.APP_URL; - if (!appUrl) { - appUrl = import.meta.env.DEV - ? "http://localhost:3000" - : window.location.protocol + "//" + window.location.host; + if (import.meta.env.DEV) { + return appUrl || "http://localhost:3000"; } - return appUrl; + return `${window.location.protocol}//${window.location.host}`; } export function getBackendUrl(): string {