bug: fix freezing not affecting processes during search and sort

Fixes a bug where searching refreshed process data even when frozen.
This commit is contained in:
Clement Tsang 2020-08-22 14:23:27 -07:00 committed by GitHub
parent 3394b9ee66
commit 1a25fbb987
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -426,9 +426,11 @@ pub fn update_all_process_lists(app: &mut App) {
.cloned() .cloned()
.collect::<Vec<_>>(); .collect::<Vec<_>>();
widget_ids.into_iter().for_each(|widget_id| { if !app.is_frozen {
update_final_process_list(app, widget_id); widget_ids.into_iter().for_each(|widget_id| {
}); update_final_process_list(app, widget_id);
});
}
} }
pub fn update_final_process_list(app: &mut App, widget_id: u64) { pub fn update_final_process_list(app: &mut App, widget_id: u64) {
@ -441,20 +443,22 @@ pub fn update_final_process_list(app: &mut App, widget_id: u64) {
}; };
let is_grouped = app.is_grouped(widget_id); let is_grouped = app.is_grouped(widget_id);
if let Some(proc_widget_state) = app.proc_state.get_mut_widget_state(widget_id) { if !app.is_frozen {
app.canvas_data.process_data = convert_process_data( if let Some(proc_widget_state) = app.proc_state.get_mut_widget_state(widget_id) {
&app.data_collection, app.canvas_data.process_data = convert_process_data(
if is_grouped { &app.data_collection,
ProcessGroupingType::Grouped if is_grouped {
} else { ProcessGroupingType::Grouped
ProcessGroupingType::Ungrouped } else {
}, ProcessGroupingType::Ungrouped
if proc_widget_state.is_using_command { },
ProcessNamingType::Path if proc_widget_state.is_using_command {
} else { ProcessNamingType::Path
ProcessNamingType::Name } else {
}, ProcessNamingType::Name
); },
);
}
} }
let process_filter = app.get_process_filter(widget_id); let process_filter = app.get_process_filter(widget_id);