Fixed an issue where saving the newly changed preferences was not reflecting on the preferences tab. #9158

This commit is contained in:
Aditya Toshniwal
2025-09-16 14:09:11 +05:30
parent 8576a5e7e6
commit e5590797c0
2 changed files with 6 additions and 3 deletions
@@ -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();
}
};