This commit is contained in:
Armin Schrenk 2023-04-17 12:51:36 +02:00
parent 4305fd3285
commit 2a01aba3cf
No known key found for this signature in database
GPG Key ID: 8F2992163CBBA7FC
2 changed files with 3 additions and 12 deletions

View File

@ -102,9 +102,9 @@ public class HubToLocalConvertController implements FxController {
Preconditions.checkState(newPasswordController.isGoodPassword());
LOG.info("Converting hub vault {} to local", vault.getPath());
CompletableFuture.runAsync(() -> conversionStarted.setValue(true), Platform::runLater) //
.thenRunAsync(this::convertInternal, backgroundExecutorService) //TODO: which executor is used?
.thenRunAsync(this::convertInternal, backgroundExecutorService)
.whenCompleteAsync((result, exception) -> {
if (exception == null) { //TODO: check, how the exceptions are wrapped
if (exception == null) {
LOG.info("Conversion of vault {} succeeded.", vault.getPath());
window.setScene(successScene.get());
} else {

View File

@ -10,24 +10,15 @@ import javafx.stage.Stage;
public class HubToLocalSuccessController implements FxController {
private final FxApplicationWindows appWindows;
private final Stage window;
private final Vault vault;
@Inject
HubToLocalSuccessController(FxApplicationWindows appWindows, @ConvertVaultWindow Stage window, @ConvertVaultWindow Vault vault) {
this.appWindows = appWindows;
HubToLocalSuccessController(@ConvertVaultWindow Stage window, @ConvertVaultWindow Vault vault) {
this.window = window;
this.vault = vault;
}
@FXML
public void unlockAndClose() {
close();
vault.getVaultConfigCache();
appWindows.startUnlockWorkflow(vault, window);
}
@FXML
public void close() {
window.close();