From bf1c01ad80f02373bfe2f68a552f9c02ec293223 Mon Sep 17 00:00:00 2001 From: Wendong-Fan Date: Wed, 3 Dec 2025 01:04:08 +0800 Subject: [PATCH] enhance: optimize installation --- electron/main/index.ts | 3 +++ src/hooks/useInstallationSetup.ts | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index 10dbee40b..5d0f0ff93 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -1354,6 +1354,9 @@ async function createWindow() { log.info('Window is ready, processing queued protocol URLs...'); processQueuedProtocolUrls(); + // Wait for React components to mount and register event listeners + await new Promise(resolve => setTimeout(resolve, 500)); + // Now check and install dependencies let res:PromiseReturnType = await checkAndInstallDepsOnUpdate({ win }); if (!res.success) { diff --git a/src/hooks/useInstallationSetup.ts b/src/hooks/useInstallationSetup.ts index 4654cd72f..11850756b 100644 --- a/src/hooks/useInstallationSetup.ts +++ b/src/hooks/useInstallationSetup.ts @@ -155,15 +155,6 @@ export const useInstallationSetup = () => { if (installationStatus.success && installationStatus.isInstalling) { startInstallation(); - } else if (initState !== 'done' && toolResult) { - if (toolResult.success && !toolResult.isInstalled) { - console.log('[useInstallationSetup] Tools missing and not installing. Starting installation...'); - try { - await performInstallation(); - } catch (installError) { - console.error('[useInstallationSetup] Installation failed:', installError); - } - } } } catch (err) { console.error('[useInstallationSetup] Failed to check installation status:', err);