File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,11 +11,24 @@ import { applySettingsChange } from '../utils/settings/applySettingsChange.js';
1111import type { SettingSource } from '../utils/settings/constants.js' ;
1212import { createStore } from './store.js' ;
1313
14- // DCE: voice context is ant-only. External builds get a passthrough.
14+ // DCE: voice context is ant-only. External builds get a noop provider that
15+ // still wraps children in VoiceContext so useVoiceState never throws.
1516/* eslint-disable @typescript-eslint/no-require-imports */
1617const VoiceProvider : ( props : { children : React . ReactNode } ) => React . ReactNode = feature ( 'VOICE_MODE' )
1718 ? require ( '../context/voice.js' ) . VoiceProvider
18- : ( { children } ) => children ;
19+ : ( ( ) => {
20+ const { VoiceContext } = require ( '../context/voice.js' ) ;
21+ const noopStore = createStore ( {
22+ voiceState : 'idle' as const ,
23+ voiceError : null as string | null ,
24+ voiceInterimTranscript : '' ,
25+ voiceAudioLevels : [ ] as number [ ] ,
26+ voiceWarmingUp : false ,
27+ } ) ;
28+ return ( { children } : { children : React . ReactNode } ) => (
29+ < VoiceContext . Provider value = { noopStore } > { children } </ VoiceContext . Provider >
30+ ) ;
31+ } ) ( ) ;
1932
2033/* eslint-enable @typescript-eslint/no-require-imports */
2134import { type AppState , type AppStateStore , getDefaultAppState } from './AppStateStore.js' ;
You can’t perform that action at this time.
0 commit comments