close popup after chill execution
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
f8b4215546
commit
814854b286
@ -2,7 +2,7 @@
|
|||||||
name = "ghost-eye"
|
name = "ghost-eye"
|
||||||
authors = ["str3tch <stretch@ghostchain.io>"]
|
authors = ["str3tch <stretch@ghostchain.io>"]
|
||||||
description = "Application for interacting with Casper/Ghost nodes that are exposing RPC only to the localhost"
|
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"
|
edition = "2021"
|
||||||
homepage = "https://git.ghostchain.io/ghostchain"
|
homepage = "https://git.ghostchain.io/ghostchain"
|
||||||
repository = "https://git.ghostchain.io/ghostchain/ghost-eye"
|
repository = "https://git.ghostchain.io/ghostchain/ghost-eye"
|
||||||
|
@ -6,6 +6,7 @@ use ratatui::{
|
|||||||
Frame
|
Frame
|
||||||
};
|
};
|
||||||
use std::sync::mpsc::Sender;
|
use std::sync::mpsc::Sender;
|
||||||
|
use tokio::sync::mpsc::UnboundedSender;
|
||||||
|
|
||||||
use super::{Component, PartialComponent, CurrentTab};
|
use super::{Component, PartialComponent, CurrentTab};
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -17,6 +18,7 @@ use crate::{
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ChillPopup {
|
pub struct ChillPopup {
|
||||||
is_active: bool,
|
is_active: bool,
|
||||||
|
action_tx: Option<UnboundedSender<Action>>,
|
||||||
network_tx: Option<Sender<Action>>,
|
network_tx: Option<Sender<Action>>,
|
||||||
secret_seed: [u8; 32],
|
secret_seed: [u8; 32],
|
||||||
palette: StylePalette
|
palette: StylePalette
|
||||||
@ -34,6 +36,7 @@ impl ChillPopup {
|
|||||||
is_active: false,
|
is_active: false,
|
||||||
secret_seed: [0u8; 32],
|
secret_seed: [0u8; 32],
|
||||||
network_tx: None,
|
network_tx: None,
|
||||||
|
action_tx: None,
|
||||||
palette: StylePalette::default(),
|
palette: StylePalette::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -41,6 +44,9 @@ impl ChillPopup {
|
|||||||
fn submit_message(&mut self) {
|
fn submit_message(&mut self) {
|
||||||
if let Some(network_tx) = &self.network_tx {
|
if let Some(network_tx) = &self.network_tx {
|
||||||
let _ = network_tx.send(Action::ChillFrom(self.secret_seed));
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn register_action_handler(&mut self, tx: UnboundedSender<Action>) -> Result<()> {
|
||||||
|
self.action_tx = Some(tx);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn register_config_handler(&mut self, config: Config) -> Result<()> {
|
fn register_config_handler(&mut self, config: Config) -> Result<()> {
|
||||||
if let Some(style) = config.styles.get(&crate::app::Mode::Wallet) {
|
if let Some(style) = config.styles.get(&crate::app::Mode::Wallet) {
|
||||||
self.palette.with_normal_style(style.get("normal_style").copied());
|
self.palette.with_normal_style(style.get("normal_style").copied());
|
||||||
|
Loading…
Reference in New Issue
Block a user