앱 버전표시
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
declare const __DESKTOP_APP_VERSION__: string | undefined;
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__GC_APP_VERSION__?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** Desktop Vite 빌드·index.html 인라인 스크립트에 주입된 앱 버전 */
|
||||
export function readBakedDesktopAppVersion(): string | null {
|
||||
if (typeof window !== 'undefined') {
|
||||
const fromWindow = window.__GC_APP_VERSION__?.trim();
|
||||
if (fromWindow) return fromWindow;
|
||||
}
|
||||
if (typeof __DESKTOP_APP_VERSION__ !== 'undefined') {
|
||||
const fromDefine = __DESKTOP_APP_VERSION__.trim();
|
||||
if (fromDefine) return fromDefine;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function formatDesktopWindowTitle(version: string | null | undefined): string {
|
||||
const v = version?.trim();
|
||||
return v ? `GoldenChart (v${v})` : 'GoldenChart';
|
||||
}
|
||||
Reference in New Issue
Block a user