fix regression and tests

This commit is contained in:
Kunal Mohan 2021-05-22 16:59:12 +05:30
parent fa0a7e05c3
commit dbc446ab55

View file

@ -258,11 +258,12 @@ pub fn start_server(os_input: Box<dyn ServerOsApi>, socket_path: PathBuf) {
}
ServerInstruction::Render(output) => {
if *session_state.read().unwrap() == SessionState::Attached {
os_input.send_to_client(
output.map_or(ServerToClientMsg::Exit(ExitReason::Normal), |op| {
ServerToClientMsg::Render(op)
}),
);
if let Some(op) = output {
os_input.send_to_client(ServerToClientMsg::Render(op));
} else {
os_input.send_to_client(ServerToClientMsg::Exit(ExitReason::Normal));
break;
}
}
}
ServerInstruction::Error(backtrace) => {