no need to run code in ui thread

This commit is contained in:
Sebastian Stenzel
2021-12-15 17:31:08 +01:00
parent 25b9722019
commit e6f43d1f05
2 changed files with 2 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ public class ReceiveKeyController implements FxController {
.build();
httpClient.sendAsync(request, HttpResponse.BodyHandlers.ofInputStream()) //
.thenAcceptAsync(this::loadedExistingKey, Platform::runLater) //
.exceptionallyAsync(this::retrievalFailed, Platform::runLater);
.exceptionally(this::retrievalFailed);
}
private void loadedExistingKey(HttpResponse<InputStream> response) {

View File

@@ -76,7 +76,7 @@ public class RegisterDeviceController implements FxController {
.build();
httpClient.sendAsync(request, HttpResponse.BodyHandlers.discarding()) //
.thenAcceptAsync(this::registrationSucceeded, Platform::runLater) //
.exceptionallyAsync(this::registrationFailed, Platform::runLater);
.exceptionally(this::registrationFailed);
}
private void registrationSucceeded(HttpResponse<Void> voidHttpResponse) {