From e569b7917aa897f7c57a098627cc304bc0a612b1 Mon Sep 17 00:00:00 2001 From: Alan Trebugeais Date: Thu, 7 May 2026 10:40:20 +0200 Subject: [PATCH] try catch on use launch window system state --- .../launch/hooks/useLaunchWindowSystemState.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/launch/hooks/useLaunchWindowSystemState.ts b/src/components/launch/hooks/useLaunchWindowSystemState.ts index e0aff177..3c22eebb 100644 --- a/src/components/launch/hooks/useLaunchWindowSystemState.ts +++ b/src/components/launch/hooks/useLaunchWindowSystemState.ts @@ -96,9 +96,13 @@ export function useLaunchWindowSystemState( }, []); const chooseRecordingsDirectory = useCallback(async () => { - const result = await window.electronAPI.chooseRecordingsDirectory(); - if (result.canceled) return; - if (result.success && result.path) setRecordingsDirectory(result.path); + try { + const result = await window.electronAPI.chooseRecordingsDirectory(); + if (result.canceled) return; + if (result.success && result.path) setRecordingsDirectory(result.path); + } catch (error) { + console.error("Failed to choose recordings directory:", error); + } }, []); const toggleHudCaptureProtection = useCallback(async () => {