fix: tx icon at sent status

This commit is contained in:
ardocrat 2024-04-21 23:37:52 +03:00
parent e4985d758b
commit 7558eebc18

View file

@ -18,7 +18,7 @@ use grin_core::core::amount_to_hr_string;
use grin_wallet_libwallet::{Slate, SlateState, TxLogEntryType}; use grin_wallet_libwallet::{Slate, SlateState, TxLogEntryType};
use crate::gui::Colors; use crate::gui::Colors;
use crate::gui::icons::{ARROW_CIRCLE_DOWN, ARROWS_CLOCKWISE, BRIDGE, CALENDAR_CHECK, CHAT_CIRCLE_TEXT, CHECK_CIRCLE, DOTS_THREE_CIRCLE, FILE_TEXT, GEAR_FINE, PROHIBIT, X_CIRCLE}; use crate::gui::icons::{ARROW_CIRCLE_DOWN, ARROW_CIRCLE_UP, ARROWS_CLOCKWISE, BRIDGE, CALENDAR_CHECK, CHAT_CIRCLE_TEXT, CHECK_CIRCLE, DOTS_THREE_CIRCLE, FILE_TEXT, GEAR_FINE, PROHIBIT, X_CIRCLE};
use crate::gui::platform::PlatformCallbacks; use crate::gui::platform::PlatformCallbacks;
use crate::gui::views::{Root, View}; use crate::gui::views::{Root, View};
use crate::gui::views::wallets::types::WalletTab; use crate::gui::views::wallets::types::WalletTab;
@ -282,12 +282,12 @@ fn tx_item_ui(ui: &mut egui::Ui,
}, },
TxLogEntryType::TxSent | TxLogEntryType::TxReceived => { TxLogEntryType::TxSent | TxLogEntryType::TxReceived => {
if data.info.last_confirmed_height - tx_height > min_conf { if data.info.last_confirmed_height - tx_height > min_conf {
let text = if tx.data.tx_type == TxLogEntryType::TxSent { let (icon, text) = if tx.data.tx_type == TxLogEntryType::TxSent {
t!("wallets.tx_sent") (ARROW_CIRCLE_UP, t!("wallets.tx_sent"))
} else { } else {
t!("wallets.tx_received") (ARROW_CIRCLE_DOWN, t!("wallets.tx_received"))
}; };
format!("{} {}", ARROW_CIRCLE_DOWN, text) format!("{} {}", icon, text)
} else { } else {
let h = data.info.last_confirmed_height; let h = data.info.last_confirmed_height;
let left_conf = h - tx_height; let left_conf = h - tx_height;