Kaynağa Gözat

fixing error where vault stays in processing state if unlock is canceld via system close button (window decoration bar)

Armin Schrenk 4 yıl önce
ebeveyn
işleme
f72035210c

+ 7 - 0
main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockController.java

@@ -74,6 +74,7 @@ public class UnlockController implements FxController {
 		this.unlockButtonContentDisplay = Bindings.createObjectBinding(this::getUnlockButtonContentDisplay, passwordEntryLock.awaitingInteraction());
 		this.userInteractionDisabled = passwordEntryLock.awaitingInteraction().not();
 		this.unlockButtonDisabled = new SimpleBooleanProperty();
+		this.window.setOnCloseRequest(windowEvent -> close());
 	}
 
 	@FXML
@@ -123,13 +124,19 @@ public class UnlockController implements FxController {
 		passwordEntryLock.awaitingInteraction().addListener(observable -> stopUnlockAnimation());
 	}
 
+
 	@FXML
 	public void cancel() {
 		LOG.debug("Unlock canceled by user.");
+		close();
+	}
+
+	private void close() {
 		window.close();
 		passwordEntryLock.interacted(UnlockModule.PasswordEntry.CANCELED);
 	}
 
+
 	@FXML
 	public void unlock() {
 		LOG.trace("UnlockController.unlock()");