try catch on use launch window system state

This commit is contained in:
Alan Trebugeais
2026-05-07 10:40:20 +02:00
parent 61b478858e
commit e569b7917a
@@ -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 () => {