mirror of
https://code.gri.mw/GUI/grim.git
synced 2026-07-10 08:54:11 +00:00
ui: ability to finalize tx only when wallet is loaded
This commit is contained in:
@@ -204,8 +204,10 @@ impl WalletTransactions {
|
||||
});
|
||||
}
|
||||
|
||||
let wallet_loaded = wallet.foreign_api_port().is_some();
|
||||
|
||||
// Draw button to show transaction finalization.
|
||||
if tx.can_finalize {
|
||||
if wallet_loaded && tx.can_finalize {
|
||||
let (icon, color) = (CHECK, Some(Colors::green()));
|
||||
View::item_button(ui, Rounding::default(), icon, color, || {
|
||||
cb.hide_keyboard();
|
||||
@@ -214,7 +216,6 @@ impl WalletTransactions {
|
||||
}
|
||||
|
||||
// Draw button to cancel transaction.
|
||||
let wallet_loaded = wallet.foreign_api_port().is_some();
|
||||
if wallet_loaded && tx.can_cancel() {
|
||||
let (icon, color) = (PROHIBIT, Some(Colors::red()));
|
||||
View::item_button(ui, Rounding::default(), icon, color, || {
|
||||
|
||||
@@ -140,8 +140,10 @@ impl WalletTransactionModal {
|
||||
return;
|
||||
}
|
||||
|
||||
let wallet_loaded = wallet.foreign_api_port().is_some();
|
||||
|
||||
// Draw button to show transaction finalization or transaction info.
|
||||
if tx.can_finalize {
|
||||
if wallet_loaded && tx.can_finalize {
|
||||
let (icon, color) = if self.show_finalization {
|
||||
(FILE_TEXT, None)
|
||||
} else {
|
||||
@@ -161,7 +163,6 @@ impl WalletTransactionModal {
|
||||
}
|
||||
|
||||
// Draw button to cancel transaction.
|
||||
let wallet_loaded = wallet.foreign_api_port().is_some();
|
||||
if wallet_loaded && tx.can_cancel() {
|
||||
View::item_button(ui, Rounding::default(), PROHIBIT, Some(Colors::red()), || {
|
||||
cb.hide_keyboard();
|
||||
|
||||
Reference in New Issue
Block a user