Create polished demo videos without editing skills. Mac/Windows/Linux
Revert "fix: stop looping startup permission prompts"
webadderall4b5af6fd2886
diff --git a/src/components/launch/LaunchWindow.tsx b/src/components/launch/LaunchWindow.tsxindex 7321b2b2..66cbe608 100644--- a/src/components/launch/LaunchWindow.tsx+++ b/src/components/launch/LaunchWindow.tsx@@ -78,6 +78,7 @@ function LaunchWindowContent() {setWebcamDeviceId,countdownDelay,setCountdownDelay,+ preparePermissions,} = useScreenRecorder();const { elapsed, formatTime } = useRecordingTimer(recording, paused);@@ -113,7 +114,7 @@ function LaunchWindowContent() {hideHudFromCapture,chooseRecordingsDirectory,toggleHudCaptureProtection,- } = useLaunchWindowSystemState();+ } = useLaunchWindowSystemState(preparePermissions);const hudCaptureProtectionSupported = supportsHudCaptureProtection(platform ?? "");diff --git a/src/components/launch/hooks/useLaunchWindowSystemState.ts b/src/components/launch/hooks/useLaunchWindowSystemState.tsindex 58dc42dd..56793fa3 100644--- a/src/components/launch/hooks/useLaunchWindowSystemState.ts+++ b/src/components/launch/hooks/useLaunchWindowSystemState.ts@@ -1,6 +1,8 @@import { useCallback, useEffect, useState } from "react";-export function useLaunchWindowSystemState() {+export function useLaunchWindowSystemState(+ preparePermissions: (args: { startup?: boolean }) => Promise<unknown>,+) {const [recordingsDirectory, setRecordingsDirectory] = useState<string | null>(null);const [hudOverlayMousePassthroughSupported, setHudOverlayMousePassthroughSupported] = useState<boolean | null@@ -63,6 +65,10 @@ export function useLaunchWindowSystemState() {};}, []);+ useEffect(() => {+ void preparePermissions({ startup: true });+ }, [preparePermissions]);+useEffect(() => {let cancelled = false;const loadVersion = async () => {diff --git a/src/hooks/useScreenRecorder.ts b/src/hooks/useScreenRecorder.tsindex 82984539..45965241 100644--- a/src/hooks/useScreenRecorder.ts+++ b/src/hooks/useScreenRecorder.ts@@ -135,7 +135,7 @@ type UseScreenRecorderReturn = {pauseRecording: () => void;resumeRecording: () => void;cancelRecording: () => void;- preparePermissions: () => Promise<boolean>;+ preparePermissions: (options?: { startup?: boolean }) => Promise<boolean>;isMacOS: boolean;microphoneEnabled: boolean;setMicrophoneEnabled: (enabled: boolean) => void;@@ -546,7 +546,7 @@ export function useScreenRecorder(): UseScreenRecorderReturn {micFallbackPauseIntervals.current = [];}, []);- const preparePermissions = useCallback(async () => {+ const preparePermissions = useCallback(async (options: { startup?: boolean } = {}) => {const platform = await window.electronAPI.getPlatform();if (platform !== "darwin") {return true;@@ -556,7 +556,9 @@ export function useScreenRecorder(): UseScreenRecorderReturn {if (!screenPermission.success || screenPermission.status !== "granted") {await window.electronAPI.openScreenRecordingPreferences();alert(- "Recordly needs Screen Recording permission before you can record. Enable it in System Settings, then quit and reopen Recordly.",+ options.startup+ ? "Recordly needs Screen Recording permission before you start. System Settings has been opened. After enabling it, quit and reopen Recordly."+ : "Screen Recording permission is still missing. System Settings has been opened again. Enable it, then quit and reopen Recordly before recording.",);return false;}@@ -577,7 +579,9 @@ export function useScreenRecorder(): UseScreenRecorderReturn {await window.electronAPI.openAccessibilityPreferences();alert(- "Recordly also needs Accessibility permission for cursor tracking. Enable it in System Settings, then quit and reopen Recordly.",+ options.startup+ ? "Recordly also needs Accessibility permission for cursor tracking. System Settings has been opened. After enabling it, quit and reopen Recordly."+ : "Accessibility permission is still missing. System Settings has been opened again. Enable it, then quit and reopen Recordly before recording.",);return false;diff --git a/src/i18n/locales/en/launch.json b/src/i18n/locales/en/launch.jsonindex eee1c3f0..d4f7aba9 100644--- a/src/i18n/locales/en/launch.json+++ b/src/i18n/locales/en/launch.json@@ -67,10 +67,10 @@"share": "Share"},"permissions": {- "screenRecordingNeeded": "Recordly needs Screen Recording permission before you can record. Enable it in System Settings, then quit and reopen Recordly.",- "screenRecordingMissing": "Recordly still needs Screen Recording permission. Enable it in System Settings, then quit and reopen Recordly.",- "accessibilityNeeded": "Recordly needs Accessibility permission for cursor tracking. Enable it in System Settings, then quit and reopen Recordly.",- "accessibilityMissing": "Recordly still needs Accessibility permission for cursor tracking. Enable it in System Settings, then quit and reopen Recordly.",+ "screenRecordingNeeded": "Recordly needs Screen Recording permission before you start. System Settings has been opened. After enabling it, quit and reopen Recordly.",+ "screenRecordingMissing": "Screen Recording permission is still missing. System Settings has been opened again. Enable it, then quit and reopen Recordly before recording.",+ "accessibilityNeeded": "Recordly also needs Accessibility permission for cursor tracking. System Settings has been opened. After enabling it, quit and reopen Recordly.",+ "accessibilityMissing": "Accessibility permission is still missing. System Settings has been opened again. Enable it, then quit and reopen Recordly before recording.","selectSource": "Please select a source to record","systemAudioUnavailable": "System audio is not available for this source. Recording will continue without system audio.","microphoneDenied": "Microphone access was denied. Recording will continue without microphone audio.",