gui: do not show network metrics without blocks
This commit is contained in:
parent
1fa3904011
commit
a3151841c6
1 changed files with 2 additions and 1 deletions
|
@ -45,7 +45,8 @@ impl NetworkTab for NetworkMetrics {
|
||||||
|
|
||||||
fn ui(&mut self, ui: &mut egui::Ui, node: &mut Node) {
|
fn ui(&mut self, ui: &mut egui::Ui, node: &mut Node) {
|
||||||
let server_stats = node.state.get_stats();
|
let server_stats = node.state.get_stats();
|
||||||
if !server_stats.is_some() {
|
// Show loading widget if server is not working or difficulty height is zero.
|
||||||
|
if !server_stats.is_some() || server_stats.as_ref().unwrap().diff_stats.height == 0 {
|
||||||
ui.centered_and_justified(|ui| {
|
ui.centered_and_justified(|ui| {
|
||||||
Spinner::new().size(42.0).color(COLOR_GRAY).ui(ui);
|
Spinner::new().size(42.0).color(COLOR_GRAY).ui(ui);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue