Przeglądaj źródła

rely on the cache directly after unlock and inject in the cache on keychain changes

Armin Schrenk 5 miesięcy temu
rodzic
commit
c888b52ebb

+ 1 - 1
src/main/java/org/cryptomator/common/keychain/KeychainManager.java

@@ -101,7 +101,7 @@ public class KeychainManager implements KeychainAccessProvider {
 	}
 
 	private void setPassphraseStored(String key, boolean value) {
-		BooleanProperty property = passphraseStoredProperties.getIfPresent(key);
+		BooleanProperty property = passphraseStoredProperties.get(key, _ -> new SimpleBooleanProperty(value));
 		if (property != null) {
 			if (Platform.isFxApplicationThread()) {
 				property.set(value);

+ 1 - 1
src/main/java/org/cryptomator/ui/keyloading/masterkeyfile/MasterkeyFileLoadingStrategy.java

@@ -113,7 +113,7 @@ public class MasterkeyFileLoadingStrategy implements KeyLoadingStrategy {
 
 	private void savePasswordToSystemkeychain(Passphrase passphrase) {
 		try {
-			if (keychain.isSupported() && !keychain.isPassphraseStored(vault.getId())) {
+			if (keychain.isSupported() && !keychain.getPassphraseStoredProperty(vault.getId()).getValue()) {
 				keychain.storePassphrase(vault.getId(), vault.getDisplayName(), passphrase);
 			}
 		} catch (KeychainAccessException e) {