From 66632e6262bb01108f785c7d82d216abbfeb540d Mon Sep 17 00:00:00 2001 From: Lucy Zhang Date: Mon, 20 Jul 2020 10:28:27 -0700 Subject: [PATCH] Fix notebook results grid settings not updating (#11413) * added boolean for results grid settings changed * change parameter name to forceThemeUpdate --- .../notebook/browser/notebookThemingContribution.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sql/workbench/contrib/notebook/browser/notebookThemingContribution.ts b/src/sql/workbench/contrib/notebook/browser/notebookThemingContribution.ts index d2778ce2eb..b7f4f932de 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebookThemingContribution.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebookThemingContribution.ts @@ -20,19 +20,20 @@ export class NotebookThemingContribution extends Disposable implements IWorkbenc private hookNotebookThemesAndConfigListener(): void { if (this.configurationService) { - this.updateNotebookThemes(); + this.updateNotebookThemes(false); this._register(this.configurationService.onDidChangeConfiguration(e => { + let affectsResultsGrid = e.affectsConfiguration('resultsGrid'); if (e.affectsConfiguration(OVERRIDE_EDITOR_THEMING_SETTING) - || e.affectsConfiguration('resultsGrid')) { - this.updateNotebookThemes(); + || affectsResultsGrid) { + this.updateNotebookThemes(affectsResultsGrid); } })); } } - private updateNotebookThemes() { + private updateNotebookThemes(forceThemeUpdate: boolean) { let overrideEditorSetting = this.configurationService.getValue(OVERRIDE_EDITOR_THEMING_SETTING); - if (overrideEditorSetting !== this.overrideEditorThemeSetting) { + if (overrideEditorSetting !== this.overrideEditorThemeSetting || forceThemeUpdate) { // Re-add the participant since this will trigger update of theming rules, can't just // update something and ask to change if (this.themeParticipant) {