앱 실시간 갱신 수정

This commit is contained in:
Macbook
2026-06-14 19:41:49 +09:00
parent c105ae209b
commit ad6347f2a2
9 changed files with 71 additions and 39 deletions
+7 -19
View File
@@ -1,30 +1,18 @@
import { getVersion } from '@tauri-apps/api/app';
import { getCurrentWindow } from '@tauri-apps/api/window';
import {
formatDesktopWindowTitle,
readBakedDesktopAppVersion,
} from '@frontend/utils/desktopAppVersion';
import { formatDesktopWindowTitle } from '@frontend/utils/desktopAppVersion';
export { formatDesktopWindowTitle } from '@frontend/utils/desktopAppVersion';
/** macOS/Windows 네이티브 창 타이틀 — GoldenChart (vX.Y.Z) */
export async function syncMainWindowTitle(): Promise<string> {
try {
const version = (await getVersion()) || readBakedDesktopAppVersion() || '';
const title = formatDesktopWindowTitle(version);
await getCurrentWindow().setTitle(title);
if (typeof document !== 'undefined' && document.title !== title) {
document.title = title;
}
return title;
} catch (e) {
const fallback = formatDesktopWindowTitle(readBakedDesktopAppVersion());
if (typeof document !== 'undefined') {
document.title = fallback;
}
console.warn('[desktop] syncMainWindowTitle failed:', e);
throw e;
const version = (await getVersion()).trim();
const title = formatDesktopWindowTitle(version);
await getCurrentWindow().setTitle(title);
if (typeof document !== 'undefined' && document.title !== title) {
document.title = title;
}
return title;
}
let titleGuardInstalled = false;