diff --git a/Cargo.toml b/Cargo.toml index ea70d65..76ec998 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "ghost-eye" authors = ["str3tch "] description = "Application for interacting with Casper/Ghost nodes that are exposing RPC only to the localhost" -version = "0.3.42" +version = "0.3.43" edition = "2021" homepage = "https://git.ghostchain.io/ghostchain" repository = "https://git.ghostchain.io/ghostchain/ghost-eye" diff --git a/src/components/validator/chill_popup.rs b/src/components/validator/chill_popup.rs index 3f17d9f..0510064 100644 --- a/src/components/validator/chill_popup.rs +++ b/src/components/validator/chill_popup.rs @@ -6,6 +6,7 @@ use ratatui::{ Frame }; use std::sync::mpsc::Sender; +use tokio::sync::mpsc::UnboundedSender; use super::{Component, PartialComponent, CurrentTab}; use crate::{ @@ -17,6 +18,7 @@ use crate::{ #[derive(Debug)] pub struct ChillPopup { is_active: bool, + action_tx: Option>, network_tx: Option>, secret_seed: [u8; 32], palette: StylePalette @@ -34,6 +36,7 @@ impl ChillPopup { is_active: false, secret_seed: [0u8; 32], network_tx: None, + action_tx: None, palette: StylePalette::default(), } } @@ -41,6 +44,9 @@ impl ChillPopup { fn submit_message(&mut self) { if let Some(network_tx) = &self.network_tx { let _ = network_tx.send(Action::ChillFrom(self.secret_seed)); + if let Some(action_tx) = &self.action_tx { + let _ = action_tx.send(Action::ClosePopup); + } } } } @@ -60,6 +66,11 @@ impl Component for ChillPopup { Ok(()) } + fn register_action_handler(&mut self, tx: UnboundedSender) -> Result<()> { + self.action_tx = Some(tx); + Ok(()) + } + fn register_config_handler(&mut self, config: Config) -> Result<()> { if let Some(style) = config.styles.get(&crate::app::Mode::Wallet) { self.palette.with_normal_style(style.get("normal_style").copied());