mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-21 20:20:55 +03:00
allow cancelling session creation
This commit is contained in:
@@ -109,7 +109,12 @@ async fn do_emulation(
|
||||
) -> Result<(), LanMouseEmulationError> {
|
||||
let backend = backend.map(|b| b.into());
|
||||
log::info!("creating input emulation...");
|
||||
let mut emulation = input_emulation::create(backend).await?;
|
||||
let mut emulation = tokio::select! {
|
||||
r = input_emulation::create(backend) => {
|
||||
r?
|
||||
}
|
||||
_ = server.cancelled() => return Ok(()),
|
||||
};
|
||||
let _ = frontend_tx
|
||||
.send(FrontendEvent::EmulationStatus(Status::Enabled))
|
||||
.await;
|
||||
|
||||
Reference in New Issue
Block a user