gui(installer): remove unused fields from final step
This commit is contained in:
parent
03c2bd76b8
commit
45f91216d5
@ -120,7 +120,6 @@ impl Installer {
|
||||
}
|
||||
|
||||
pub fn update(&mut self, message: Message) -> Command<Message> {
|
||||
let hot_signer_fingerprint = self.signer.lock().unwrap().fingerprint();
|
||||
match message {
|
||||
Message::CreateWallet => {
|
||||
self.steps = vec![
|
||||
@ -132,7 +131,7 @@ impl Installer {
|
||||
SelectBitcoindTypeStep::new().into(),
|
||||
InternalBitcoindStep::new(&self.context.data_dir).into(),
|
||||
DefineBitcoind::new().into(),
|
||||
Final::new(hot_signer_fingerprint).into(),
|
||||
Final::new().into(),
|
||||
];
|
||||
self.next()
|
||||
}
|
||||
@ -147,7 +146,7 @@ impl Installer {
|
||||
SelectBitcoindTypeStep::new().into(),
|
||||
InternalBitcoindStep::new(&self.context.data_dir).into(),
|
||||
DefineBitcoind::new().into(),
|
||||
Final::new(hot_signer_fingerprint).into(),
|
||||
Final::new().into(),
|
||||
];
|
||||
self.next()
|
||||
}
|
||||
@ -160,7 +159,7 @@ impl Installer {
|
||||
SelectBitcoindTypeStep::new().into(),
|
||||
InternalBitcoindStep::new(&self.context.data_dir).into(),
|
||||
DefineBitcoind::new().into(),
|
||||
Final::new(hot_signer_fingerprint).into(),
|
||||
Final::new().into(),
|
||||
];
|
||||
self.next()
|
||||
}
|
||||
|
||||
@ -16,7 +16,6 @@ pub use mnemonic::{BackupMnemonic, RecoverMnemonic};
|
||||
use std::path::PathBuf;
|
||||
|
||||
use iced::{Command, Subscription};
|
||||
use liana::miniscript::bitcoin::bip32::Fingerprint;
|
||||
|
||||
use liana_ui::widget::*;
|
||||
|
||||
@ -66,40 +65,28 @@ pub struct Final {
|
||||
internal_bitcoind: Option<Bitcoind>,
|
||||
warning: Option<String>,
|
||||
config_path: Option<PathBuf>,
|
||||
hot_signer_fingerprint: Fingerprint,
|
||||
hot_signer_is_not_used: bool,
|
||||
}
|
||||
|
||||
impl Final {
|
||||
pub fn new(hot_signer_fingerprint: Fingerprint) -> Self {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
internal_bitcoind: None,
|
||||
generating: false,
|
||||
warning: None,
|
||||
config_path: None,
|
||||
hot_signer_fingerprint,
|
||||
hot_signer_is_not_used: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Final {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl Step for Final {
|
||||
fn load_context(&mut self, ctx: &Context) {
|
||||
self.internal_bitcoind = ctx.internal_bitcoind.clone();
|
||||
if let Some(signer) = &ctx.recovered_signer {
|
||||
self.hot_signer_fingerprint = signer.fingerprint();
|
||||
self.hot_signer_is_not_used = false;
|
||||
} else if ctx
|
||||
.descriptor
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.to_string()
|
||||
.contains(&self.hot_signer_fingerprint.to_string())
|
||||
{
|
||||
self.hot_signer_is_not_used = false;
|
||||
} else {
|
||||
self.hot_signer_is_not_used = true;
|
||||
}
|
||||
}
|
||||
fn load(&self) -> Command<Message> {
|
||||
if !self.generating && self.config_path.is_none() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user