switch back to UI thread later

see https://github.com/cryptomator/cryptomator/pull/3287#discussion_r1453196792
This commit is contained in:
Sebastian Stenzel 2024-01-17 13:35:23 +01:00
parent 2225476bf8
commit a1b712495f
No known key found for this signature in database

View File

@ -130,7 +130,7 @@ public class ReceiveKeyController implements FxController {
.timeout(REQ_TIMEOUT) //
.build();
httpClient.sendAsync(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)) //
.thenAcceptAsync(this::receivedDeviceData, Platform::runLater) //
.thenAcceptAsync(this::receivedDeviceData) //
.exceptionally(this::retrievalFailed);
}
@ -147,7 +147,7 @@ public class ReceiveKeyController implements FxController {
var device = JSON.reader().readValue(response.body(), DeviceDto.class);
requestVaultMasterkey(device.userPrivateKey);
}
case 404 -> needsDeviceRegistration();
case 404 -> Platform.runLater(this::needsDeviceRegistration);
default -> throw new IllegalStateException("Unexpected response " + response.statusCode());
}
} catch (IOException e) {