1
0
mirror of https://github.com/4yn/slidershim.git synced 2024-11-27 23:10:49 +01:00

reset brokenithm input on close controller

This commit is contained in:
4yn 2022-03-18 20:57:53 +08:00
parent 61505c2375
commit 8fbb9e4d9f

View File

@ -136,12 +136,18 @@ async fn handle_brokenithm(
}
Message::Close(_) => {
info!("Websocket connection closed");
let mut input_handle = state_handle.input.lock();
input_handle.ground.fill(0);
input_handle.air.fill(0);
break;
}
_ => {}
},
Err(e) => {
error!("Websocket connection error: {}", e);
let mut input_handle = state_handle.input.lock();
input_handle.ground.fill(0);
input_handle.air.fill(0);
break;
}
},