fix: is_oxker_in_container()

Check is both is_oxker and running in a container, so that oxker container commands will only be ignored if both are true
This commit is contained in:
Jack Wills
2024-01-13 23:01:22 +00:00
parent 52d1610ac6
commit a34c046dee
2 changed files with 11 additions and 6 deletions
+6 -1
View File
@@ -470,6 +470,12 @@ impl AppData {
self.get_selected_container().map_or(false, |i| i.is_oxker)
}
/// Check if selected container is oxker and also that oxker is being run in a container
pub fn is_oxker_in_container(&self) -> bool {
self.get_selected_container()
.map_or(false, |i| i.is_oxker && self.args.in_container)
}
/// Find the widths for the strings in the containers panel.
/// So can display nicely and evenly
pub fn get_width(&self) -> Columns {
@@ -1820,7 +1826,6 @@ mod tests {
assert_ne!(&result_pre, result_post);
assert_eq!(result_post[0].state, State::Paused);
assert_eq!(result_post[1].state, State::Dead);
}
#[test]
+1 -1
View File
@@ -272,7 +272,7 @@ impl InputHandler {
if let Some(command) = option_command {
// Poor way of disallowing commands to be sent to a containerised okxer
if self.app_data.lock().is_oxker() {
if self.app_data.lock().is_oxker_in_container() {
return;
};
let option_id = self.app_data.lock().get_selected_container_id();