Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

branding.ts

18 lines708 Bytes

1import type { DesktopAppBranding } from "@t3tools/contracts";
2​
3function readInjectedDesktopAppBranding(): DesktopAppBranding | null {
4 if (typeof window === "undefined") {
5 return null;
6 }
7​
8 return window.desktopBridge?.getAppBranding?.() ?? null;
9}
10​
11const injectedDesktopAppBranding = readInjectedDesktopAppBranding();
12​
13export const APP_BASE_NAME = injectedDesktopAppBranding?.baseName ?? "T3 Code";
14export const APP_STAGE_LABEL =
15 injectedDesktopAppBranding?.stageLabel ?? (import.meta.env.DEV ? "Dev" : "Alpha");
16export const APP_DISPLAY_NAME =
17 injectedDesktopAppBranding?.displayName ?? `${APP_BASE_NAME} (${APP_STAGE_LABEL})`;
18export const APP_VERSION = import.meta.env.APP_VERSION || "0.0.0";