Skip to content

Commit

Permalink
Remove redundant button
Browse files Browse the repository at this point in the history
  • Loading branch information
TaQuangKhoi committed Aug 14, 2024
1 parent 4fee120 commit 47c1916
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
14 changes: 0 additions & 14 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,6 @@ impl eframe::App for TwoDBApp {
ui.menu_button("Update", |ui| {
self.render_clean_tables_button(ui);
self.render_get_empty_tables_button(ui);

if ui.button("Get Clean Tables for Target").clicked() {
let database_name = var("POSTGRES_DB_TARGET").unwrap_or(String::from(""));
get_clean_tables(&database_name);
let text = format!("Done Get Clean Tables for {}", database_name);
toasts.add(Toast {
text: text.into(),
kind: ToastKind::Success,
options: ToastOptions::default()
.duration_in_seconds(5.0)
.show_progress(true),
..Default::default()
});
}
});

if self.is_busy.eq(&true) {
Expand Down
10 changes: 5 additions & 5 deletions src/get_clean_tables_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ impl TwoDBApp {
.anchor(Align2::RIGHT_BOTTOM, (-10.0, -10.0)) // 10 units from the bottom right corner
.direction(egui::Direction::BottomUp);

let database_name = var("POSTGRES_DB_SOURCE").unwrap_or(String::from(""));
get_clean_tables(&database_name);
let database_name_source = var("POSTGRES_DB_SOURCE").unwrap_or(String::from(""));
get_clean_tables(&database_name_source);

let database_name = var("POSTGRES_DB_TARGET").unwrap_or(String::from(""));
get_clean_tables(&database_name);
let database_name_target = var("POSTGRES_DB_TARGET").unwrap_or(String::from(""));
get_clean_tables(&database_name_target);

let text = format!("Done Get Clean Tables for {}", database_name);
let text = format!("Done Get Clean Tables for {} and {}", database_name_source, database_name_target);
thread_toasts.add(Toast {
text: text.into(),
kind: ToastKind::Success,
Expand Down

0 comments on commit 47c1916

Please sign in to comment.