fix(update): electron update function (#32)

This commit is contained in:
Haze
2026-02-10 15:20:04 +08:00
committed by GitHub
Unverified
parent e8a7377525
commit 9e5fdc5631
4 changed files with 168 additions and 2 deletions

View File

@@ -129,7 +129,10 @@ export const useUpdateStore = create<UpdateState>((set, get) => ({
set({ status: 'checking', error: null });
try {
const result = await window.electron.ipcRenderer.invoke('update:check') as {
const result = await Promise.race([
window.electron.ipcRenderer.invoke('update:check'),
new Promise((_, reject) => setTimeout(() => reject(new Error('Update check timed out')), 30000))
]) as {
success: boolean;
info?: UpdateInfo;
error?: string;