dont activate multiple times

This commit is contained in:
Ferdinand Schober
2024-09-21 19:47:34 +02:00
parent b16f3b272a
commit ed7771691f

View File

@@ -203,10 +203,9 @@ async fn handle_capture_event(
return release_capture(capture, server).await;
}
if event == CaptureEvent::Begin {
if *state != State::Sending {
*state = State::WaitingForAck;
}
// activated a new client
if event == CaptureEvent::Begin && Some(handle) != server.get_active() {
*state = State::WaitingForAck;
server.set_active(Some(handle));
spawn_hook_command(server, handle);
}