From 57323e1104b9ed35c4b60489eed9603798112c77 Mon Sep 17 00:00:00 2001 From: Joao Silva <100691367+JoaoSilvaGrafana@users.noreply.github.com> Date: Wed, 31 Jul 2024 11:07:08 +0100 Subject: [PATCH] Preferences: Keep navbar preferences when saving from Preferences screen (#91197) --- .../core/components/SharedPreferences/SharedPreferences.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/app/core/components/SharedPreferences/SharedPreferences.tsx b/public/app/core/components/SharedPreferences/SharedPreferences.tsx index a294f78cd4e..be0d48bb87d 100644 --- a/public/app/core/components/SharedPreferences/SharedPreferences.tsx +++ b/public/app/core/components/SharedPreferences/SharedPreferences.tsx @@ -73,6 +73,7 @@ export class SharedPreferences extends PureComponent { weekStart: '', language: '', queryHistory: { homeTab: '' }, + navbar: { bookmarkIds: [] }, }; this.themeOptions = getBuiltInThemes(config.featureToggles.extraThemes).map((theme) => ({ @@ -94,6 +95,7 @@ export class SharedPreferences extends PureComponent { weekStart: prefs.weekStart, language: prefs.language, queryHistory: prefs.queryHistory, + navbar: prefs.navbar, }); } @@ -102,8 +104,8 @@ export class SharedPreferences extends PureComponent { const confirmationResult = this.props.onConfirm ? await this.props.onConfirm() : true; if (confirmationResult) { - const { homeDashboardUID, theme, timezone, weekStart, language, queryHistory } = this.state; - await this.service.update({ homeDashboardUID, theme, timezone, weekStart, language, queryHistory }); + const { homeDashboardUID, theme, timezone, weekStart, language, queryHistory, navbar } = this.state; + await this.service.update({ homeDashboardUID, theme, timezone, weekStart, language, queryHistory, navbar }); window.location.reload(); } };