Shared layout, tabs, and sidebar timer; user onboarding and registration polish; settings danger zone and data export; chart and tRPC perf fixes; migrations for onboarding and dropped appearance columns. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
544 B
TypeScript
21 lines
544 B
TypeScript
/** Public app origin (no trailing slash). */
|
|
export function getAppUrl(): string {
|
|
if (typeof window !== "undefined") {
|
|
return window.location.origin.replace(/\/$/, "");
|
|
}
|
|
|
|
const fromEnv = process.env.NEXT_PUBLIC_APP_URL?.trim();
|
|
if (fromEnv) return fromEnv.replace(/\/$/, "");
|
|
|
|
return `http://localhost:${process.env.PORT ?? 3000}`;
|
|
}
|
|
|
|
/** Hostname for display (e.g. marketing browser chrome). */
|
|
export function getAppHost(): string {
|
|
try {
|
|
return new URL(getAppUrl()).host;
|
|
} catch {
|
|
return "beenvoice.app";
|
|
}
|
|
}
|