mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-04-20 01:26:52 -04:00
@@ -73,7 +73,7 @@ public class UnlockController implements FxController {
|
||||
if (keychainAccess.isPresent()) {
|
||||
loadStoredPassword();
|
||||
} else {
|
||||
savePassword.setDisable(true);
|
||||
savePassword.setSelected(false);
|
||||
}
|
||||
unlockButtonDisabled.bind(vault.stateProperty().isNotEqualTo(VaultState.LOCKED).or(passwordField.textProperty().isEmpty()));
|
||||
}
|
||||
@@ -91,10 +91,8 @@ public class UnlockController implements FxController {
|
||||
|
||||
Task<Vault> task = vaultService.createUnlockTask(vault, password);
|
||||
passwordField.setDisable(true);
|
||||
savePassword.setDisable(true);
|
||||
task.setOnSucceeded(event -> {
|
||||
passwordField.setDisable(false);
|
||||
savePassword.setDisable(!keychainAccess.isPresent());
|
||||
if (keychainAccess.isPresent() && savePassword.isSelected()) {
|
||||
try {
|
||||
keychainAccess.get().storePassphrase(vault.getId(), password);
|
||||
@@ -108,7 +106,6 @@ public class UnlockController implements FxController {
|
||||
});
|
||||
task.setOnFailed(event -> {
|
||||
passwordField.setDisable(false);
|
||||
savePassword.setDisable(!keychainAccess.isPresent());
|
||||
if (task.getException() instanceof InvalidPassphraseException) {
|
||||
Animations.createShakeWindowAnimation(window).play();
|
||||
passwordField.selectAll();
|
||||
@@ -190,4 +187,8 @@ public class UnlockController implements FxController {
|
||||
public boolean isUnlockButtonDisabled() {
|
||||
return unlockButtonDisabled.get();
|
||||
}
|
||||
|
||||
public boolean isKeychainAccessAvailable() {
|
||||
return keychainAccess.isPresent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<VBox spacing="6">
|
||||
<FormattedLabel format="%unlock.passwordPrompt" arg1="${controller.vault.displayableName}" wrapText="true"/>
|
||||
<NiceSecurePasswordField fx:id="passwordField"/>
|
||||
<CheckBox fx:id="savePassword" text="%unlock.savePassword" onAction="#didClickSavePasswordCheckbox"/>
|
||||
<CheckBox fx:id="savePassword" text="%unlock.savePassword" onAction="#didClickSavePasswordCheckbox" disable="${controller.vault.processing}" visible="${controller.keychainAccessAvailable}"/>
|
||||
</VBox>
|
||||
|
||||
<VBox alignment="BOTTOM_CENTER" VBox.vgrow="ALWAYS">
|
||||
|
||||
Reference in New Issue
Block a user