fix: tx ui on repost

This commit is contained in:
ardocrat
2025-11-21 01:33:53 +03:00
parent 11a5a73775
commit 646a7c5e04
4 changed files with 53 additions and 38 deletions
+19 -17
View File
@@ -175,24 +175,26 @@ impl WalletTransactions {
});
}
let rebroadcast = tx.broadcasting_timed_out(wallet);
if !tx.cancelled() && !tx.cancelling() && !tx.posting() {
let rebroadcast = tx.broadcasting_timed_out(wallet);
// Draw button to cancel transaction.
if tx.can_cancel() || rebroadcast {
let (icon, color) = (PROHIBIT, Some(Colors::red()));
View::item_button(ui, CornerRadius::default(), icon, color, || {
self.confirm_cancel_tx_id = Some(tx.data.id);
// Show transaction cancellation confirmation modal.
Modal::new(CANCEL_TX_CONFIRMATION_MODAL)
.position(ModalPosition::Center)
.title(t!("confirmation"))
.show();
});
}
// Draw button to repeat transaction action.
if tx.can_repeat_action() || rebroadcast {
Self::tx_repeat_button_ui(ui, CornerRadius::default(), tx, wallet, rebroadcast);
// Draw button to cancel transaction.
if tx.can_cancel() || rebroadcast {
let (icon, color) = (PROHIBIT, Some(Colors::red()));
View::item_button(ui, CornerRadius::default(), icon, color, || {
self.confirm_cancel_tx_id = Some(tx.data.id);
// Show transaction cancellation confirmation modal.
Modal::new(CANCEL_TX_CONFIRMATION_MODAL)
.position(ModalPosition::Center)
.title(t!("confirmation"))
.show();
});
}
// Draw button to repeat transaction action.
if tx.can_repeat_action() || rebroadcast {
Self::tx_repeat_button_ui(ui, CornerRadius::default(), tx, wallet, rebroadcast);
}
}
});
}
+23 -21
View File
@@ -258,29 +258,31 @@ impl WalletTransactionContent {
});
}
let rebroadcast = tx.broadcasting_timed_out(&wallet);
if !tx.cancelled() && !tx.cancelling() && !tx.posting() {
let rebroadcast = tx.broadcasting_timed_out(&wallet);
// Draw button to cancel transaction.
if tx.can_cancel() || rebroadcast {
let r = if tx.can_finalize() {
CornerRadius::default()
} else {
View::item_rounding(0, 2, true)
};
View::item_button(ui, r, PROHIBIT, Some(Colors::red()), || {
wallet.task(WalletTask::Cancel(tx.clone()));
Modal::close();
});
}
// Draw button to cancel transaction.
if tx.can_cancel() || rebroadcast {
let r = if tx.can_finalize() {
CornerRadius::default()
} else {
View::item_rounding(0, 2, true)
};
View::item_button(ui, r, PROHIBIT, Some(Colors::red()), || {
wallet.task(WalletTask::Cancel(tx.clone()));
Modal::close();
});
}
// Draw button to repeat transaction action.
if tx.can_repeat_action() || rebroadcast {
let r = if tx.can_finalize() || tx.can_cancel() {
CornerRadius::default()
} else {
View::item_rounding(0, 2, true)
};
WalletTransactions::tx_repeat_button_ui(ui, r, tx, wallet, rebroadcast);
// Draw button to repeat transaction action.
if tx.can_repeat_action() || rebroadcast {
let r = if tx.can_finalize() || tx.can_cancel() {
CornerRadius::default()
} else {
View::item_rounding(0, 2, true)
};
WalletTransactions::tx_repeat_button_ui(ui, r, tx, wallet, rebroadcast);
}
}
});