added default fallback for prod
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { env } from "$env/dynamic/public";
|
import { env } from "$env/dynamic/public";
|
||||||
|
|
||||||
export const WS_SCRCPY_URL = env.PUBLIC_WS_SCRCPY_SVC_URL ?? "";
|
export const WS_SCRCPY_URL =
|
||||||
|
env.PUBLIC_WS_SCRCPY_SVC_URL ?? "https://iotam-ws-scrcpy.snapyra.com";
|
||||||
|
|
||||||
export const TRANSITION_COLORS = "transition-colors duration-150 ease-in-out";
|
export const TRANSITION_COLORS = "transition-colors duration-150 ease-in-out";
|
||||||
export const TRANSITION_ALL = "transition-all duration-150 ease-in-out";
|
export const TRANSITION_ALL = "transition-all duration-150 ease-in-out";
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ export const secondaryNavTree = [
|
|||||||
},
|
},
|
||||||
] as AppSidebarItem[];
|
] as AppSidebarItem[];
|
||||||
|
|
||||||
export const WS_SCRCPY_URL = env.PUBLIC_WS_SCRCPY_SVC_URL;
|
export const WS_SCRCPY_URL =
|
||||||
|
env.PUBLIC_WS_SCRCPY_SVC_URL ?? "https://iotam-ws-scrcpy.snapyra.com";
|
||||||
|
|
||||||
export const COMPANY_NAME = "SaaS Template";
|
export const COMPANY_NAME = "SaaS Template";
|
||||||
export const WEBSITE_URL = "https://company.com";
|
export const WEBSITE_URL = "https://company.com";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
import { Input } from "$lib/components/ui/input";
|
import { Input } from "$lib/components/ui/input";
|
||||||
import { Label } from "$lib/components/ui/label";
|
import { Label } from "$lib/components/ui/label";
|
||||||
import * as Table from "$lib/components/ui/table";
|
import * as Table from "$lib/components/ui/table";
|
||||||
import { env } from "$env/dynamic/public";
|
import { PUBLIC_FRONTEND_URL } from "$env/static/public";
|
||||||
import MaxWidthWrapper from "$lib/components/molecules/max-width-wrapper.svelte";
|
import MaxWidthWrapper from "$lib/components/molecules/max-width-wrapper.svelte";
|
||||||
import { mainNavTree } from "$lib/core/constants";
|
import { mainNavTree } from "$lib/core/constants";
|
||||||
import { linkVM } from "$lib/domains/link/link.vm.svelte";
|
import { linkVM } from "$lib/domains/link/link.vm.svelte";
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildPublicLink(token: string): string {
|
function buildPublicLink(token: string): string {
|
||||||
const base = env.PUBLIC_FRONTEND_URL?.trim() || "/";
|
const base = PUBLIC_FRONTEND_URL?.trim() || "/";
|
||||||
const origin = typeof window !== "undefined" ? window.location.origin : "http://localhost";
|
const origin = typeof window !== "undefined" ? window.location.origin : "http://localhost";
|
||||||
const url = new URL(base, origin);
|
const url = new URL(base, origin);
|
||||||
url.searchParams.set("token", token);
|
url.searchParams.set("token", token);
|
||||||
|
|||||||
@@ -84,3 +84,9 @@ Update rule:
|
|||||||
### 11 — Admin Link Copy Full URL
|
### 11 — Admin Link Copy Full URL
|
||||||
|
|
||||||
- Refactored admin links-page copy action to copy full public frontend access URLs (`PUBLIC_FRONTEND_URL?token=...`) instead of raw tokens.
|
- Refactored admin links-page copy action to copy full public frontend access URLs (`PUBLIC_FRONTEND_URL?token=...`) instead of raw tokens.
|
||||||
|
|
||||||
|
### 12 — Main App Production Env Access Fix
|
||||||
|
|
||||||
|
- Replaced client-facing `$env/dynamic/public` usage with `$env/static/public` in shared constants and links page code.
|
||||||
|
- Fixed production crash path where browser bundle attempted to read runtime `env` from an undefined object during hydration/update.
|
||||||
|
- Kept behavior unchanged for `PUBLIC_WS_SCRCPY_SVC_URL` and `PUBLIC_FRONTEND_URL` consumers while making access compile-time safe.
|
||||||
|
|||||||
Reference in New Issue
Block a user