desktop 앱 적용

This commit is contained in:
Macbook
2026-06-14 10:15:54 +09:00
parent 7a2f65088c
commit 86b99d8c10
81 changed files with 8164 additions and 37 deletions
+26
View File
@@ -0,0 +1,26 @@
import { check } from '@tauri-apps/plugin-updater';
import { relaunch } from '@tauri-apps/plugin-process';
import { getVersion } from '@tauri-apps/api/app';
export async function getAppVersion(): Promise<string> {
return getVersion();
}
export async function checkForUpdates(): Promise<{
available: boolean;
version?: string;
message?: string;
}> {
try {
const update = await check();
if (!update) {
return { available: false, message: '최신 버전입니다.' };
}
await update.downloadAndInstall();
await relaunch();
return { available: true, version: update.version, message: '업데이트 설치 후 재시작합니다.' };
} catch (e) {
const msg = e instanceof Error ? e.message : '업데이트 확인 실패';
return { available: false, message: msg };
}
}