refactor: rewrite callback for on-click event

This commit is contained in:
doryan 2024-08-16 13:58:19 +04:00
parent 3fdac01687
commit ddff777d58

View File

@ -124,18 +124,20 @@ pub fn signal_reducing_page(wrapper: &Box) {
result_table, result_table,
move |_| match parse_fields(all_inputs.clone()) { move |_| match parse_fields(all_inputs.clone()) {
Ok(results) => { Ok(results) => {
values.set(results); if values.get() == results {
info_bar.set_text_label(Some("Эти данные уже были введены."));
let new_elem = Frequency::new(values.get().frequency);
let exist_elem_pos = find_by_frequency_value(&model, &new_elem);
if exist_elem_pos.is_some() {
info_bar.set_text_label(Some("Данная частота уже была задана."));
info_bar.show_infobar(5u64); info_bar.show_infobar(5u64);
} else { } else {
model.append(&new_elem); values.set(results);
update_column_view(&result_table)
let new_elem = Frequency::new(values.get().frequency);
let exist_elem_pos = find_by_frequency_value(&model, &new_elem);
if exist_elem_pos.is_none() {
model.append(&new_elem);
}
update_column_view(&result_table);
} }
} }
Err(error) => { Err(error) => {