From 7bd22c8e9232713ae59710a0a996f874932d53cf Mon Sep 17 00:00:00 2001 From: kn0sys Date: Fri, 20 Sep 2024 07:08:47 -0400 Subject: [PATCH] initialize b32 destination on gui home screen --- .gitignore | 19 ++++++------------- neveko-gui/src/apps/home.rs | 8 +++++--- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 52a0af6..7f9e510 100644 --- a/.gitignore +++ b/.gitignore @@ -13,24 +13,17 @@ notes.txt monero-x86_64-linux-gnu-v*/ *.jar opt/* -eventlog.txt -libjcpuid.so -router.config -router.ping -libjbigi.so -wrapper.log -keyBackup/privateEncryption.key -keyBackup/privateSigning.key -keyBackup/publicEncryption.key -keyBackup/publicSigning.key -logs/log-0.txt +*.so +*.config +*.log +*.key router.info router.keys.dat prngseed.rnd hostsdb.blockfile -logs/log-1.txt certificates/ netDb/* peerProfiles/* *.dat -ssu2tokens.txt +*.txt +*.txt.gz diff --git a/neveko-gui/src/apps/home.rs b/neveko-gui/src/apps/home.rs index 76920a6..9e3da4e 100644 --- a/neveko-gui/src/apps/home.rs +++ b/neveko-gui/src/apps/home.rs @@ -18,6 +18,7 @@ use std::{ }; pub struct HomeApp { + b32_destination: String, /// blocks fetched during last wallet refresh blocks_fetched: u64, wallet_height: u64, @@ -65,6 +66,8 @@ pub struct HomeApp { impl Default for HomeApp { fn default() -> Self { + let b32_destination = i2p::get_destination(i2p::ServerTunnelType::App) + .unwrap_or(String::from("error: b32 address not found.")); let blocks_fetched = 0; let connections = Default::default(); let is_core_running = false; @@ -100,6 +103,7 @@ impl Default for HomeApp { egui_extras::RetainedImage::from_image_bytes("./assets/i2p.png", &c_i2p_logo).unwrap(); let wallet_height = 0; Self { + b32_destination, blocks_fetched, connections, core_timeout_rx, @@ -339,10 +343,8 @@ impl eframe::App for HomeApp { ui.horizontal(|ui| { self.logo_i2p.show(ui); ui.horizontal(|ui| { - let i2p_address = i2p::get_destination(i2p::ServerTunnelType::App) - .unwrap_or_default(); ui.label( - RichText::new(format!("- status: {}\n- address: {}", str_i2p_status, i2p_address)) + RichText::new(format!("- status: {}\n- address: {}", str_i2p_status, self.b32_destination)) .size(16.0) .color(color), ).on_hover_text(hover_txt);