Skip to content
Snippets Groups Projects
Commit f3b51501 authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

#174 - Fix concurrent modification issue

parent 12c230af
No related branches found
No related tags found
No related merge requests found
......@@ -63,10 +63,11 @@ public class WebApiRemoteConnectionStateListener implements MainWindowListener {
}
private void createConnectionStateBinding() {
final List<PlayPadClient> clients = new ArrayList<>(WebApiPlugin$.MODULE$.connections().values());
connectedProperty.bind(Bindings.createIntegerBinding(() -> (int) WebApiPlugin$.MODULE$.connections().values().stream()
.filter(client -> client.getPlayPadConnectionState() != WebSocketState.OPEN)
.count(),
WebApiPlugin$.MODULE$.connections().values().stream()
clients.stream()
.map(PlayPadClient::playPadConnectionState)
.toArray(ObjectProperty[]::new))
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment