Merge pull request #2322 from JoePfeiffer/fix-2321

Store updated units preferences if needed
This commit is contained in:
Joe Pfeiffer 2023-09-15 05:45:16 -06:00 committed by GitHub
commit 4fb4a8a590
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();
}