try catch on use launch window system state

This commit is contained in:
Alan Trebugeais committed 2026-05-07 10:40:20 +02:00
1 parent 6f6fe8c2ba
commit 1758896c91
1 file changed
+7 -3
@@ -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 () => {