From e5590797c02896992907e6162c187c82914106fb Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Tue, 16 Sep 2025 14:09:11 +0530 Subject: [PATCH] Fixed an issue where saving the newly changed preferences was not reflecting on the preferences tab. #9158 --- docs/en_US/release_notes_9_9.rst | 2 ++ .../static/js/components/PreferencesComponent.jsx | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/en_US/release_notes_9_9.rst b/docs/en_US/release_notes_9_9.rst index 1236a37a3..6c399f5b7 100644 --- a/docs/en_US/release_notes_9_9.rst +++ b/docs/en_US/release_notes_9_9.rst @@ -31,3 +31,5 @@ Housekeeping Bug fixes ********* + | `Issue #9158 `_ - Fixed an issue where saving the newly changed preferences was not reflecting on the preferences tab. + diff --git a/web/pgadmin/preferences/static/js/components/PreferencesComponent.jsx b/web/pgadmin/preferences/static/js/components/PreferencesComponent.jsx index 5bbe44598..9970951f5 100644 --- a/web/pgadmin/preferences/static/js/components/PreferencesComponent.jsx +++ b/web/pgadmin/preferences/static/js/components/PreferencesComponent.jsx @@ -182,8 +182,8 @@ export default function PreferencesComponent({panelId}) { }); valuesVersionRef.current = new Date().getTime(); - setPrefTreeData(treeNodesData); setInitValues(values); + setPrefTreeData(treeNodesData); setSelectedItem(selectedItem || treeNodesData[0]?.children[0]); prefSchema.current = new PreferencesSchema(values, schemaFields); setLoaderText(null); @@ -241,6 +241,7 @@ export default function PreferencesComponent({panelId}) { if (_data.length === 0) { // No changes to save, just close modal + setLoaderText(null); return; } @@ -309,7 +310,7 @@ export default function PreferencesComponent({panelId}) { } } preferencesStore.cache(); // Refresh preferences cache - fetchPreferences(); + await fetchPreferences(); } catch (err) { pgAdmin.Browser.notifier.alert(err.response?.data || err.message || gettext('Failed to save preferences.')); } @@ -328,7 +329,7 @@ export default function PreferencesComponent({panelId}) { gettext('Cancel') ); } else { - saveData(); + await saveData(); } };