File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ export class VoiceChatService extends Disposable implements IVoiceChatService {
126
126
const disposables = new DisposableStore ( ) ;
127
127
128
128
const onSessionStoppedOrCanceled = ( dispose : boolean ) => {
129
- this . activeVoiceChatSessions -- ;
129
+ this . activeVoiceChatSessions = Math . max ( 0 , this . activeVoiceChatSessions - 1 ) ;
130
130
if ( this . activeVoiceChatSessions === 0 ) {
131
131
this . voiceChatInProgress . reset ( ) ;
132
132
}
Original file line number Diff line number Diff line change @@ -665,7 +665,10 @@ export class StopListeningAndSubmitAction extends Action2 {
665
665
f1 : true ,
666
666
keybinding : {
667
667
weight : KeybindingWeight . WorkbenchContrib ,
668
- when : FocusInChatInput ,
668
+ when : ContextKeyExpr . and (
669
+ FocusInChatInput ,
670
+ AnyScopedVoiceChatInProgress
671
+ ) ,
669
672
primary : KeyMod . CtrlCmd | KeyCode . KeyI
670
673
} ,
671
674
precondition : GlobalVoiceChatInProgress // need global context here because of `f1: true`
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ export class SpeechService extends Disposable implements ISpeechService {
153
153
const disposables = new DisposableStore ( ) ;
154
154
155
155
const onSessionStoppedOrCanceled = ( ) => {
156
- this . activeSpeechToTextSessions -- ;
156
+ this . activeSpeechToTextSessions = Math . max ( 0 , this . activeSpeechToTextSessions - 1 ) ;
157
157
if ( ! this . hasActiveSpeechToTextSession ) {
158
158
this . speechToTextInProgress . reset ( ) ;
159
159
}
@@ -264,7 +264,7 @@ export class SpeechService extends Disposable implements ISpeechService {
264
264
const disposables = new DisposableStore ( ) ;
265
265
266
266
const onSessionStoppedOrCanceled = ( dispose : boolean ) => {
267
- this . activeTextToSpeechSessions -- ;
267
+ this . activeTextToSpeechSessions = Math . max ( 0 , this . activeTextToSpeechSessions - 1 ) ;
268
268
if ( ! this . hasActiveTextToSpeechSession ) {
269
269
this . textToSpeechInProgress . reset ( ) ;
270
270
}
@@ -406,7 +406,7 @@ export class SpeechService extends Disposable implements ISpeechService {
406
406
const disposables = new DisposableStore ( ) ;
407
407
408
408
const onSessionStoppedOrCanceled = ( ) => {
409
- this . activeKeywordRecognitionSessions -- ;
409
+ this . activeKeywordRecognitionSessions = Math . max ( 0 , this . activeKeywordRecognitionSessions - 1 ) ;
410
410
this . _onDidEndKeywordRecognition . fire ( ) ;
411
411
412
412
disposables . dispose ( ) ;
You can’t perform that action at this time.
0 commit comments