Fixed "Locked Vault Options after unlocking vault #3249" (#3267)

Fixes #3249 

Bound the UIs disabled state to the vault's lock state without the need of a map
This commit is contained in:
GiwrgosTsifoutis
2024-01-16 13:32:36 +02:00
committed by GitHub
parent daa026b285
commit 828fd321cc

View File

@@ -1,6 +1,7 @@
package org.cryptomator.ui.vaultoptions;
import org.cryptomator.common.vaults.Vault;
import org.cryptomator.common.vaults.VaultState;
import org.cryptomator.ui.common.FxController;
import org.cryptomator.ui.keyloading.hub.HubKeyLoadingStrategy;
import org.cryptomator.ui.keyloading.masterkeyfile.MasterkeyFileLoadingStrategy;
@@ -48,6 +49,10 @@ public class VaultOptionsController implements FxController {
if(!(vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTP) || vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTPS))){
tabPane.getTabs().remove(hubTab);
}
vault.stateProperty().addListener(observable -> {
tabPane.setDisable(vault.getState().equals(VaultState.Value.UNLOCKED));
});
}
private void selectChosenTab() {