Prevent downgrading DiagResult in progress screen
This commit is contained in:
parent
185ddf3103
commit
1d0b692028
1 changed files with 17 additions and 2 deletions
|
|
@ -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 } => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue