client: fix APP_URL
This commit is contained in:
parent
a0b31804d9
commit
d429384d22
2 changed files with 3 additions and 6 deletions
|
|
@ -19,7 +19,6 @@ import { getAppUrl } from "@/lib/config.ts";
|
||||||
import { extractPageSlugId } from "@/lib";
|
import { extractPageSlugId } from "@/lib";
|
||||||
import { treeApiAtom } from "@/features/page/tree/atoms/tree-api-atom.ts";
|
import { treeApiAtom } from "@/features/page/tree/atoms/tree-api-atom.ts";
|
||||||
import { useDeletePageModal } from "@/features/page/hooks/use-delete-page-modal.tsx";
|
import { useDeletePageModal } from "@/features/page/hooks/use-delete-page-modal.tsx";
|
||||||
import { boolean } from "zod";
|
|
||||||
|
|
||||||
interface PageHeaderMenuProps {
|
interface PageHeaderMenuProps {
|
||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,11 @@ declare global {
|
||||||
export function getAppUrl(): string {
|
export function getAppUrl(): string {
|
||||||
let appUrl = window.CONFIG?.APP_URL || process.env.APP_URL;
|
let appUrl = window.CONFIG?.APP_URL || process.env.APP_URL;
|
||||||
|
|
||||||
if (!appUrl) {
|
if (import.meta.env.DEV) {
|
||||||
appUrl = import.meta.env.DEV
|
return appUrl || "http://localhost:3000";
|
||||||
? "http://localhost:3000"
|
|
||||||
: window.location.protocol + "//" + window.location.host;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return appUrl;
|
return `${window.location.protocol}//${window.location.host}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getBackendUrl(): string {
|
export function getBackendUrl(): string {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue