Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update the available balance in console wallet #3760

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions applications/tari_console_wallet/src/ui/components/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,12 @@ impl<B: Backend> Component<B> for Balance {
f.render_widget(block, area);

let balance = app_state.get_balance();

let time_locked = balance.time_locked_balance.unwrap_or_else(|| MicroTari::from(0u64));
let available_balance = Spans::from(vec![
Span::styled("Available:", Style::default().fg(Color::Magenta)),
delta1 marked this conversation as resolved.
Show resolved Hide resolved
Span::raw(" "),
Span::raw(format!("{}", balance.available_balance)),
Span::raw(format!(
" (Time Locked: {})",
balance.time_locked_balance.unwrap_or_else(|| MicroTari::from(0u64))
)),
Span::raw(format!("{}", balance.available_balance.saturating_sub(time_locked))),
Span::raw(format!(" (Time Locked: {})", time_locked)),
]);
let incoming_balance = Spans::from(vec![
Span::styled("Pending Incoming:", Style::default().fg(Color::Magenta)),
Expand Down