Fix market overview

This commit is contained in:
2026-07-23 00:30:57 +02:00
parent e4773db9d8
commit b76a1f9aed
2 changed files with 17 additions and 11 deletions
+9 -2
View File
@@ -137,7 +137,7 @@ struct Property(&'static str, String);
impl Formatted for MarketOverview { impl Formatted for MarketOverview {
fn get_formatted(&self) -> Vec<String> { fn get_formatted(&self) -> Vec<String> {
vec![ let mut o = vec![
Property("TREND", format!("{}", self.trend)), Property("TREND", format!("{}", self.trend)),
Property("VOLATILITY", format!("{}", self.volatility)), Property("VOLATILITY", format!("{}", self.volatility)),
Property( Property(
@@ -149,7 +149,14 @@ impl Formatted for MarketOverview {
}, },
), ),
] ]
.get_formatted() .get_formatted();
o.push(format!(
"\n{}",
apply_padding(self.alerts.get_formatted()).join("\n")
));
o
} }
} }
+7 -8
View File
@@ -226,14 +226,13 @@ impl App for PulseTradeApp {
.await, .await,
), ),
), ),
(LayoutItem::Widget(Size::Flex(1)), { (
let mo = self.market_overview.lock().await; LayoutItem::Widget(Size::Flex(1)),
Box::new(format!( Box::new(
" MARKET OVERVIEW\n{}\n\n{}", advanced_draw(&self.scroll, 2, "MARKET OVERVIEW", &self.market_overview)
apply_padding(mo.get_formatted()).join("\n"), .await,
apply_padding(mo.alerts.get_formatted()).join("\n") ),
)) ),
}),
]), ]),
); );