Store updated units preferences if needed

This commit is contained in:
JoePfeiffer 2023-09-13 10:29:55 -06:00
parent 3595a6d39e
commit 39e6ba18e1

View File

@ -141,8 +141,10 @@ public class PreferencesDialog extends JDialog {
// We don't want to lose the preference for the confirmation dialog
boolean isShowDiscardConfirmation = preferences.isShowDiscardPreferencesConfirmation();
// Reload initial preferences
if (!storePreferences) {
// Either store changed preferences (if OK) or reload initial preferences (if Cancel)
if (storePreferences) {
preferences.storeDefaultUnits();
} else {
loadInitPreferences();
}