Skip to content

Commit 043e26c

Browse files
authored
Merge pull request microsoft#188422 from microsoft/merogge/prevent-response
prevent response from being accepted by the accessibility service repeatedly
2 parents 3146dbd + 13e7663 commit 043e26c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/vs/workbench/contrib/chat/browser/chatAccessibilityService.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export class ChatAccessibilityService extends Disposable implements IChatAccessi
1919
private _responsePendingAudioCue: IDisposable | undefined;
2020
private _hasReceivedRequest: boolean = false;
2121
private _runOnceScheduler: RunOnceScheduler;
22+
private _lastResponse: string | undefined;
2223

2324
constructor(@IAudioCueService private readonly _audioCueService: IAudioCueService) {
2425
super();
@@ -37,6 +38,10 @@ export class ChatAccessibilityService extends Disposable implements IChatAccessi
3738
const isPanelChat = typeof response !== 'string';
3839
this._responsePendingAudioCue?.dispose();
3940
this._runOnceScheduler?.cancel();
41+
if (this._lastResponse === response?.toString()) {
42+
return;
43+
}
44+
this._lastResponse = response?.toString();
4045
this._audioCueService.playAudioCue(AudioCue.chatResponseReceived, true);
4146
this._hasReceivedRequest = false;
4247
if (!response) {

0 commit comments

Comments
 (0)