Revert "fix(mac-perms): fall through to Privacy pane when in-app prompt is a no-op (#1273)"

This reverts commit fb3d46710b.
This commit is contained in:
Jinwoo-H
2026-04-30 16:05:52 -04:00
parent ad4627a098
commit 3fa8912a99
2 changed files with 3 additions and 34 deletions
+3 -22
View File
@@ -147,32 +147,13 @@ async function requestPermission(
}
if (id === 'microphone' || id === 'camera') {
// Why: askForMediaAccess only surfaces the TCC prompt when status is
// 'not-determined'. If the user previously denied (or macOS set the status
// to 'denied'/'restricted'), it resolves false with no prompt — leaving
// the user stuck. Fall through to the Privacy pane so they can toggle it.
const granted = await systemPreferences.askForMediaAccess(id)
if (granted) {
return { id, status: 'granted', openedSystemSettings: false }
}
const status = getMediaStatus(id)
if (status === 'denied' || status === 'restricted' || status === 'unknown') {
await openPrivacyPane(id)
return { id, status, openedSystemSettings: true }
}
return { id, status, openedSystemSettings: false }
return { id, status: granted ? 'granted' : getMediaStatus(id), openedSystemSettings: false }
}
if (id === 'accessibility') {
// Why: isTrustedAccessibilityClient(true) shows the prompt only the first
// time for a given bundle. Once the user has dismissed or denied, calling
// it again is a no-op. Fall through to the Privacy pane when not granted.
const trusted = systemPreferences.isTrustedAccessibilityClient(true)
if (trusted) {
return { id, status: 'granted', openedSystemSettings: false }
}
await openPrivacyPane(id)
return { id, status: getAccessibilityStatus(), openedSystemSettings: true }
systemPreferences.isTrustedAccessibilityClient(true)
return { id, status: getAccessibilityStatus(), openedSystemSettings: false }
}
if (id === 'automation') {
@@ -179,18 +179,6 @@ export function DeveloperPermissionsPane(): React.JSX.Element {
void refresh()
}, [refresh])
// Why: after the user flips a permission in System Settings and switches
// back to Orca, the chip should reflect the new status without a manual
// Refresh click. Tied to window focus rather than a polling interval so
// we don't keep hammering `systemPreferences` while the pane is idle.
useEffect(() => {
const onFocus = (): void => {
void refresh()
}
window.addEventListener('focus', onFocus)
return () => window.removeEventListener('focus', onFocus)
}, [refresh])
const request = async (id: DeveloperPermissionId): Promise<void> => {
setPendingId(id)
try {