From 33d28b9f969bec71cd3d88bb118ec06248d9fdca Mon Sep 17 00:00:00 2001 From: weartist Date: Sun, 30 Jul 2023 16:04:51 +0800 Subject: [PATCH] Fix: #188760 --- .../parts/editor/accessibilityStatus.ts | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/accessibilityStatus.ts b/src/vs/workbench/browser/parts/editor/accessibilityStatus.ts index 7d464e04454..de65eca21f0 100644 --- a/src/vs/workbench/browser/parts/editor/accessibilityStatus.ts +++ b/src/vs/workbench/browser/parts/editor/accessibilityStatus.ts @@ -40,29 +40,27 @@ export class AccessibilityStatus extends Disposable implements IWorkbenchContrib } private showScreenReaderNotification(): void { - if (!this.screenReaderNotification) { - this.screenReaderNotification = this.notificationService.prompt( - Severity.Info, - localize('screenReaderDetectedExplanation.question', "Are you using a screen reader to operate VS Code?"), - [{ - label: localize('screenReaderDetectedExplanation.answerYes', "Yes"), - run: () => { - this.configurationService.updateValue('editor.accessibilitySupport', 'on', ConfigurationTarget.USER); - } - }, { - label: localize('screenReaderDetectedExplanation.answerNo', "No"), - run: () => { - this.configurationService.updateValue('editor.accessibilitySupport', 'off', ConfigurationTarget.USER); - } - }], - { - sticky: true, - priority: NotificationPriority.URGENT + this.screenReaderNotification = this.notificationService.prompt( + Severity.Info, + localize('screenReaderDetectedExplanation.question', "Are you using a screen reader to operate VS Code?"), + [{ + label: localize('screenReaderDetectedExplanation.answerYes', "Yes"), + run: () => { + this.configurationService.updateValue('editor.accessibilitySupport', 'on', ConfigurationTarget.USER); } - ); + }, { + label: localize('screenReaderDetectedExplanation.answerNo', "No"), + run: () => { + this.configurationService.updateValue('editor.accessibilitySupport', 'off', ConfigurationTarget.USER); + } + }], + { + sticky: true, + priority: NotificationPriority.URGENT + } + ); - Event.once(this.screenReaderNotification.onDidClose)(() => this.screenReaderNotification = null); - } + Event.once(this.screenReaderNotification.onDidClose)(() => this.screenReaderNotification = null); } private updateScreenReaderModeElement(visible: boolean): void { if (visible) {