mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-04-20 09:36:55 -04:00
simplifying the state enum to prevent illegal states
This commit is contained in:
@@ -412,22 +412,22 @@ public class UnlockController implements ViewController {
|
||||
/* state */
|
||||
|
||||
public enum State {
|
||||
UNLOCKING(false),
|
||||
INITIALIZED("unlock.successLabel.vaultCreated", true),
|
||||
PASSWORD_CHANGED("unlock.successLabel.passwordChanged", true),
|
||||
UPGRADED("unlock.successLabel.upgraded", true);
|
||||
UNLOCKING(),
|
||||
INITIALIZED("unlock.successLabel.vaultCreated"),
|
||||
PASSWORD_CHANGED("unlock.successLabel.passwordChanged"),
|
||||
UPGRADED("unlock.successLabel.upgraded");
|
||||
|
||||
private Optional<String> successMessage;
|
||||
private boolean shouldShowStatusMessage;
|
||||
|
||||
State(boolean shouldShowStatusMessage) {
|
||||
State() {
|
||||
this.successMessage = Optional.empty();
|
||||
this.shouldShowStatusMessage = shouldShowStatusMessage;
|
||||
this.shouldShowStatusMessage = false;
|
||||
}
|
||||
|
||||
State(String successMessage, boolean shouldShowStatusMessage) {
|
||||
State(String successMessage) {
|
||||
this.successMessage = Optional.of(successMessage);
|
||||
this.shouldShowStatusMessage = shouldShowStatusMessage;
|
||||
this.shouldShowStatusMessage = true;
|
||||
}
|
||||
|
||||
public Optional<String> successMessage() {
|
||||
|
||||
Reference in New Issue
Block a user