Revert "fix: stop looping startup permission prompts"

This reverts commit 158b141c4f.
This commit is contained in:
webadderall
2026-09-05 16:31:26 +10:00
parent 158b141c4f
commit 490eb546f1
4 changed files with 21 additions and 10 deletions
+2 -1
View File
@@ -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 ?? "");
@@ -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 () => {
+8 -4
View File
@@ -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;
+4 -4
View File
@@ -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.",