do not reset mountflags to default ones when window opens

This commit is contained in:
Armin Schrenk 2023-01-22 19:24:35 +01:00
parent 94fe8ca449
commit 09d5f71335
No known key found for this signature in database
GPG Key ID: 8F2992163CBBA7FC

View File

@ -109,7 +109,10 @@ public class MountOptionsController implements FxController {
if (customMountFlagsCheckbox.isSelected()) {
readOnlyCheckbox.setSelected(false); // to prevent invalid states
mountFlagsField.textProperty().unbind();
vaultSettings.mountFlags().set(defaultMountFlags.getValue());
var mountFlags = vaultSettings.mountFlags().get();
if(mountFlags == null || mountFlags.isBlank()) {
vaultSettings.mountFlags().set(defaultMountFlags.getValue());
}
mountFlagsField.textProperty().bindBidirectional(vaultSettings.mountFlags());
} else {
mountFlagsField.textProperty().unbindBidirectional(vaultSettings.mountFlags());