Browse Source

Replaced dependency with call to getter

JaniruTEC 4 năm trước cách đây
mục cha
commit
313f8b36d2

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 2 - 8
main/ui/src/main/java/org/cryptomator/ui/preferences/GeneralPreferencesController.java


+ 2 - 4
main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java

@@ -32,19 +32,17 @@ public class RecoveryKeyCreationController implements FxController {
 	private final ExecutorService executor;
 	private final RecoveryKeyFactory recoveryKeyFactory;
 	private final StringProperty recoveryKeyProperty;
-	private final Lazy<Scene> createScene;
 	private final ErrorComponent.Builder errorComponent;
 	public NiceSecurePasswordField passwordField;
 
 	@Inject
-	public RecoveryKeyCreationController(@RecoveryKeyWindow Stage window, @FxmlScene(FxmlFile.RECOVERYKEY_SUCCESS) Lazy<Scene> successScene, @RecoveryKeyWindow Vault vault, RecoveryKeyFactory recoveryKeyFactory, ExecutorService executor, @RecoveryKeyWindow StringProperty recoveryKey, @FxmlScene(FxmlFile.RECOVERYKEY_CREATE) Lazy<Scene> createScene, ErrorComponent.Builder errorComponent) {
+	public RecoveryKeyCreationController(@RecoveryKeyWindow Stage window, @FxmlScene(FxmlFile.RECOVERYKEY_SUCCESS) Lazy<Scene> successScene, @RecoveryKeyWindow Vault vault, RecoveryKeyFactory recoveryKeyFactory, ExecutorService executor, @RecoveryKeyWindow StringProperty recoveryKey, ErrorComponent.Builder errorComponent) {
 		this.window = window;
 		this.successScene = successScene;
 		this.vault = vault;
 		this.executor = executor;
 		this.recoveryKeyFactory = recoveryKeyFactory;
 		this.recoveryKeyProperty = recoveryKey;
-		this.createScene = createScene;
 		this.errorComponent = errorComponent;
 	}
 
@@ -64,7 +62,7 @@ public class RecoveryKeyCreationController implements FxController {
 				Animations.createShakeWindowAnimation(window).play();
 			} else {
 				LOG.error("Creation of recovery key failed.", task.getException());
-				errorComponent.cause(task.getException()).window(window).returnToScene(createScene.get()).build().showErrorScene();
+				errorComponent.cause(task.getException()).window(window).returnToScene(window.getScene()).build().showErrorScene();
 			}
 		});
 		executor.submit(task);