diff --git a/node-launchpad/src/app.rs b/node-launchpad/src/app.rs index f0b3359f5c..e7850afcc5 100644 --- a/node-launchpad/src/app.rs +++ b/node-launchpad/src/app.rs @@ -122,7 +122,7 @@ impl App { let change_connection_mode = ChangeConnectionModePopUp::new(connection_mode)?; let port_range = PortRangePopUp::new(connection_mode, port_from, port_to); let rewards_address = RewardsAddress::new(app_data.discord_username.clone()); - let upgrade_nodes = UpgradeNodesPopUp::new(app_data.nodes_to_start); + let upgrade_nodes = UpgradeNodesPopUp::new(); let remove_node = RemoveNodePopUp::default(); Ok(Self { diff --git a/node-launchpad/src/components/options.rs b/node-launchpad/src/components/options.rs index edf57cf730..52392ca22b 100644 --- a/node-launchpad/src/components/options.rs +++ b/node-launchpad/src/components/options.rs @@ -374,7 +374,7 @@ impl Component for Options { | Scene::ChangePortsPopUp { .. } | Scene::OptionsRewardsAddressPopUp | Scene::ResetNodesPopUp - | Scene::UpgradeNodesPopUp { .. } => { + | Scene::UpgradeNodesPopUp => { self.active = true; // make sure we're in navigation mode return Ok(Some(Action::SwitchInputMode(InputMode::Navigation))); diff --git a/node-launchpad/src/components/popup/upgrade_nodes.rs b/node-launchpad/src/components/popup/upgrade_nodes.rs index e940a02908..f5004cf97b 100644 --- a/node-launchpad/src/components/popup/upgrade_nodes.rs +++ b/node-launchpad/src/components/popup/upgrade_nodes.rs @@ -19,17 +19,19 @@ use crossterm::event::{KeyCode, KeyEvent}; use ratatui::{prelude::*, widgets::*}; pub struct UpgradeNodesPopUp { - amount_of_nodes: usize, /// Whether the component is active right now, capturing keystrokes + draw things. active: bool, } impl UpgradeNodesPopUp { - pub fn new(amount_of_nodes: usize) -> Self { - Self { - amount_of_nodes, - active: false, - } + pub fn new() -> Self { + Self { active: false } + } +} + +impl Default for UpgradeNodesPopUp { + fn default() -> Self { + Self::new() } } @@ -134,9 +136,7 @@ impl Component for UpgradeNodesPopUp { )), Line::from(Span::styled( format!( - "Upgrade time ~ {:.1?} mins ({:?} nodes * {:?} secs)", - self.amount_of_nodes * (node_mgmt::FIXED_INTERVAL / 1_000) as usize / 60, - self.amount_of_nodes, + "Upgrade time is {:.1?} seconds per node", node_mgmt::FIXED_INTERVAL / 1_000, ), Style::default().fg(LIGHT_PERIWINKLE),