mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
Don't unfail if deposit or delayedpayout txs are missing
This commit is contained in:
parent
817819dc51
commit
486f254773
2 changed files with 17 additions and 2 deletions
|
@ -864,6 +864,8 @@ portfolio.failed.unfail=Before proceeding, make sure you have a backup of your d
|
|||
This is a way to unlock funds stuck in a failed trade.
|
||||
portfolio.failed.cantUnfail=This trade cannot be moved back to open trades at the moment. \n\
|
||||
Try again after completion of trade(s) {0}
|
||||
portfolio.failed.depositTxNull=The trade cannot be completed. Deposit transaction is null
|
||||
portfolio.failed.delayedPayoutTxNull=The trade cannot be completed. Delayed payout transaction is null
|
||||
|
||||
|
||||
####################################################################
|
||||
|
|
|
@ -108,10 +108,13 @@ public class FailedTradesView extends ActivatableViewAndModel<VBox, FailedTrades
|
|||
|
||||
keyEventEventHandler = keyEvent -> {
|
||||
if (Utilities.isAltOrCtrlPressed(KeyCode.Y, keyEvent)) {
|
||||
var checkTxs = checkTxs();
|
||||
var checkUnfailString = checkUnfail();
|
||||
if (!checkUnfailString.isEmpty()) {
|
||||
if (!checkTxs.isEmpty()) {
|
||||
new Popup().warning(checkTxs)
|
||||
.show();
|
||||
} else if (!checkUnfailString.isEmpty()) {
|
||||
new Popup().warning(Res.get("portfolio.failed.cantUnfail", checkUnfailString))
|
||||
.onAction(this::onUnfail)
|
||||
.show();
|
||||
} else {
|
||||
new Popup().warning(Res.get("portfolio.failed.unfail"))
|
||||
|
@ -131,7 +134,17 @@ public class FailedTradesView extends ActivatableViewAndModel<VBox, FailedTrades
|
|||
private String checkUnfail() {
|
||||
Trade trade = sortedList.get(tableView.getSelectionModel().getFocusedIndex()).getTrade();
|
||||
return model.dataModel.checkUnfail(trade);
|
||||
}
|
||||
|
||||
private String checkTxs() {
|
||||
Trade trade = sortedList.get(tableView.getSelectionModel().getFocusedIndex()).getTrade();
|
||||
if (trade.getDepositTx() == null) {
|
||||
return Res.get("portfolio.failed.depositTxNull");
|
||||
}
|
||||
if (trade.getDelayedPayoutTx() == null) {
|
||||
return Res.get("portfolio.failed.delayedPayoutTxNull");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue