Revert "fix(terminal): terminal mic access" (#1057)
This commit is contained in:
parent
f0c96bd2bf
commit
e6abe45bc7
|
|
@ -2,8 +2,6 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.device.audio-input</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { app, BrowserWindow, nativeImage, nativeTheme, systemPreferences } from 'electron'
|
||||
import { app, BrowserWindow, nativeImage, nativeTheme } from 'electron'
|
||||
import { electronApp, is } from '@electron-toolkit/utils'
|
||||
import devIcon from '../../resources/icon-dev.png?asset'
|
||||
import { Store, initDataPath } from './persistence'
|
||||
|
|
@ -58,26 +58,6 @@ let rateLimits: RateLimitService | null = null
|
|||
let runtimeRpc: OrcaRuntimeRpcServer | null = null
|
||||
let starNag: StarNagService | null = null
|
||||
|
||||
function triggerStartupMicrophoneRegistration(): void {
|
||||
if (process.platform !== 'darwin') {
|
||||
return
|
||||
}
|
||||
try {
|
||||
const status = systemPreferences.getMediaAccessStatus('microphone')
|
||||
if (status !== 'not-determined') {
|
||||
return
|
||||
}
|
||||
// Why: terminal child processes (sox/ffmpeg/voice CLIs) cannot reliably
|
||||
// surface the TCC dialog themselves. Prompt once from the app process after
|
||||
// the window is visible so mic capture in embedded terminals can work.
|
||||
void systemPreferences.askForMediaAccess('microphone').catch((error: unknown) => {
|
||||
console.error('[permissions] Failed to request microphone access:', error)
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('[permissions] Failed to check microphone access status:', error)
|
||||
}
|
||||
}
|
||||
|
||||
installUncaughtPipeErrorGuard()
|
||||
// Why: propagate the Orca app version into `process.env` so PTY-env
|
||||
// construction in both main (local-pty-provider) and the forked daemon
|
||||
|
|
@ -284,7 +264,6 @@ app.whenReady().then(async () => {
|
|||
// window, making it impossible for the user to click "Allow".
|
||||
win.once('show', () => {
|
||||
triggerStartupNotificationRegistration(store!)
|
||||
triggerStartupMicrophoneRegistration()
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
|
|
|
|||
|
|
@ -155,7 +155,6 @@ export function useDiffCommentDecorator({
|
|||
})
|
||||
|
||||
disposablesRef.current = [onMouseMove, onMouseLeave, onScroll]
|
||||
const zones = zonesRef.current
|
||||
|
||||
return () => {
|
||||
for (const d of disposablesRef.current) {
|
||||
|
|
@ -170,10 +169,10 @@ export function useDiffCommentDecorator({
|
|||
// stale zone ids from a dead editor. The diff effect below deliberately
|
||||
// has no cleanup so comment-only changes don't cause a full zone
|
||||
// rebuild; this cleanup is the single place we reset zone tracking.
|
||||
for (const entry of zones.values()) {
|
||||
for (const entry of zonesRef.current.values()) {
|
||||
entry.root.unmount()
|
||||
}
|
||||
zones.clear()
|
||||
zonesRef.current.clear()
|
||||
}
|
||||
}, [editor])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue