mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
voice - fix hold mode in presence of lazy activation (#208884)
This commit is contained in:
parent
298c42a605
commit
3a3c5c4b1c
|
@ -462,22 +462,18 @@ async function startVoiceChatWithHoldMode(id: string, accessor: ServicesAccessor
|
|||
|
||||
const holdMode = keybindingService.enableKeybindingHoldMode(id);
|
||||
|
||||
let session: IVoiceChatSession | undefined = undefined;
|
||||
const controller = await VoiceChatSessionControllerFactory.create(accessor, target);
|
||||
if (!controller) {
|
||||
return;
|
||||
}
|
||||
|
||||
const session = await VoiceChatSessions.getInstance(instantiationService).start(controller, context);
|
||||
|
||||
let acceptVoice = false;
|
||||
const handle = disposableTimeout(() => {
|
||||
acceptVoice = true;
|
||||
session?.setTimeoutDisabled(true); // disable accept on timeout when hold mode runs for VOICE_KEY_HOLD_THRESHOLD
|
||||
}, VOICE_KEY_HOLD_THRESHOLD);
|
||||
|
||||
const controller = await VoiceChatSessionControllerFactory.create(accessor, target);
|
||||
if (!controller) {
|
||||
handle.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
session = await VoiceChatSessions.getInstance(instantiationService).start(controller, context);
|
||||
|
||||
await holdMode;
|
||||
handle.dispose();
|
||||
|
||||
|
|
Loading…
Reference in a new issue