Prevent downgrading DiagResult in progress screen

This commit is contained in:
2Shirt 2025-06-13 19:01:05 -07:00
parent 185ddf3103
commit 1d0b692028
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -86,8 +86,23 @@ impl Component for Progress {
&result, &text
);
if let Some(line) = self.lines.last_mut() {
line.result = result;
line.text = text;
let old_result = line.result.clone();
match (old_result, result.clone()) {
(DiagResult::Pass, _) => {
line.result = result;
line.text = text;
}
(DiagResult::Warn, DiagResult::Pass | DiagResult::Warn) => {
line.text = String::from("Unknown");
}
(DiagResult::Warn, DiagResult::Fail) => {
line.result = DiagResult::Fail;
line.text = String::from("Unknown");
}
(DiagResult::Fail, _) => {
line.text = String::from("Unknown");
}
};
}
}
Action::DiagLineEnd { text } => {