From 26f82f3cc791c29573f12f7e2c1243e257dfdeaf Mon Sep 17 00:00:00 2001 From: ardocrat Date: Sat, 4 May 2024 02:27:38 +0300 Subject: [PATCH] txs: cancelling status --- locales/en.yml | 1 + locales/ru.yml | 1 + src/gui/views/wallets/wallet/txs.rs | 28 +++++++++++++++++++--------- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/locales/en.yml b/locales/en.yml index ecc7e19..202a4af 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -71,6 +71,7 @@ wallets: tx_receiving: Receiving tx_confirming: Awaiting confirmation tx_canceled: Canceled + tx_cancelling: Cancelling tx_finalizing: Finalizing tx_confirmed: Confirmed txs: Transactions diff --git a/locales/ru.yml b/locales/ru.yml index 81ae5fd..36a8501 100644 --- a/locales/ru.yml +++ b/locales/ru.yml @@ -71,6 +71,7 @@ wallets: tx_receiving: Получение tx_confirming: Ожидает подтверждения tx_canceled: Отменено + tx_cancelling: Отмена tx_finalizing: Завершение tx_confirmed: Подтверждено txs: Транзакции diff --git a/src/gui/views/wallets/wallet/txs.rs b/src/gui/views/wallets/wallet/txs.rs index 14f5525..33527a4 100644 --- a/src/gui/views/wallets/wallet/txs.rs +++ b/src/gui/views/wallets/wallet/txs.rs @@ -365,15 +365,25 @@ impl WalletTransactions { } else if tx.posting { format!("{} {}", DOTS_THREE_CIRCLE, t!("wallets.tx_finalizing")) } else { - match tx.data.tx_type { - TxLogEntryType::TxReceived => { - format!("{} {}", DOTS_THREE_CIRCLE, t!("wallets.tx_receiving")) - }, - TxLogEntryType::TxSent => { - format!("{} {}", DOTS_THREE_CIRCLE, t!("wallets.tx_sending")) - }, - _ => { - format!("{} {}", DOTS_THREE_CIRCLE, t!("wallets.tx_confirmed")) + if tx.cancelling { + format!("{} {}", DOTS_THREE_CIRCLE, t!("wallets.tx_cancelling")) + } else { + match tx.data.tx_type { + TxLogEntryType::TxReceived => { + format!("{} {}", + DOTS_THREE_CIRCLE, + t!("wallets.tx_receiving")) + }, + TxLogEntryType::TxSent => { + format!("{} {}", + DOTS_THREE_CIRCLE, + t!("wallets.tx_sending")) + }, + _ => { + format!("{} {}", + DOTS_THREE_CIRCLE, + t!("wallets.tx_confirmed")) + } } } }