Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve user experience once mediation has been accepted by both parties #5870

Merged
merged 4 commits into from Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions core/src/main/java/bisq/core/trade/TradeManager.java
Expand Up @@ -261,12 +261,12 @@ private void handleTakeOfferRequest(NodeAddress peer, InputsForDepositTxRequest
try {
Validator.nonEmptyStringOf(inputsForDepositTxRequest.getTradeId());
} catch (Throwable t) {
log.warn("Invalid inputsForDepositTxRequest " + inputsForDepositTxRequest.toString());
log.warn("Invalid inputsForDepositTxRequest " + inputsForDepositTxRequest);
return;
}

Optional<OpenOffer> openOfferOptional = openOfferManager.getOpenOfferById(inputsForDepositTxRequest.getTradeId());
if (!openOfferOptional.isPresent()) {
if (openOfferOptional.isEmpty()) {
return;
}

Expand Down Expand Up @@ -702,9 +702,10 @@ public void onTradeCompleted(Trade trade) {
public void closeDisputedTrade(String tradeId, Trade.DisputeState disputeState) {
getTradeById(tradeId).ifPresent(trade -> {
trade.setDisputeState(disputeState);
checkNotNull(trade.getContract(), "Trade contract must not be null");
trade.setState(trade.getContract().isMyRoleBuyer(keyRing.getPubKeyRing()) ?
Trade.State.BUYER_RECEIVED_PAYOUT_TX_PUBLISHED_MSG : // buyer to trade step 4
Trade.State.SELLER_SAW_ARRIVED_PAYOUT_TX_PUBLISHED_MSG); // seller to trade step 4
Trade.State.BUYER_RECEIVED_PAYOUT_TX_PUBLISHED_MSG : // buyer to trade step 4
Trade.State.SELLER_SAW_ARRIVED_PAYOUT_TX_PUBLISHED_MSG); // seller to trade step 4
btcWalletService.swapTradeEntryToAvailableEntry(trade.getId(), AddressEntry.Context.TRADE_PAYOUT);
requestPersistence();
});
Expand Down
13 changes: 3 additions & 10 deletions core/src/main/resources/i18n/displayStrings.properties
Expand Up @@ -904,16 +904,9 @@ portfolio.pending.step5_buyer.tradeFee=Trade fee
portfolio.pending.step5_buyer.makersMiningFee=Mining fee
portfolio.pending.step5_buyer.takersMiningFee=Total mining fees
portfolio.pending.step5_buyer.refunded=Refunded security deposit
portfolio.pending.step5_buyer.withdrawBTC=Withdraw your bitcoin
portfolio.pending.step5_buyer.amount=Amount to withdraw
portfolio.pending.step5_buyer.withdrawToAddress=Withdraw to address
portfolio.pending.step5_buyer.moveToBisqWallet=Keep funds in Bisq wallet
portfolio.pending.step5_buyer.withdrawExternal=Withdraw to external wallet
portfolio.pending.step5_buyer.alreadyWithdrawn=Your funds have already been withdrawn.\nPlease check the transaction history.
portfolio.pending.step5_buyer.confirmWithdrawal=Confirm withdrawal request
portfolio.pending.step5_buyer.amountTooLow=The amount to transfer is lower than the transaction fee and the min. possible tx value (dust).
portfolio.pending.step5_buyer.withdrawalCompleted.headline=Withdrawal completed
portfolio.pending.step5_buyer.withdrawalCompleted.msg=Your completed trades are stored under \"Portfolio/History\".\nYou can review all your bitcoin transactions under \"Funds/Transactions\"
portfolio.pending.step5_buyer.tradeCompleted.headline=Trade completed
portfolio.pending.step5_buyer.tradeCompleted.msg=Your completed trades are stored under \"Portfolio/History\".\nYou can review all your bitcoin transactions under \"Funds/Transactions\"
portfolio.pending.step5_buyer.bought=You have bought
portfolio.pending.step5_buyer.paid=You have paid

Expand Down Expand Up @@ -3142,7 +3135,7 @@ notification.walletUpdate.headline=Trading wallet update
notification.walletUpdate.msg=Your trading wallet is sufficiently funded.\nAmount: {0}
notification.takeOffer.walletUpdate.msg=Your trading wallet was already sufficiently funded from an earlier take offer attempt.\nAmount: {0}
notification.tradeCompleted.headline=Trade completed
notification.tradeCompleted.msg=You can withdraw your funds now to your external Bitcoin wallet or transfer it to the Bisq wallet.
notification.tradeCompleted.msg=You can withdraw your funds now to your external Bitcoin wallet from Funds > Send Funds.
notification.bsqSwap.maker.headline=BSQ swap completed
notification.bsqSwap.maker.tradeCompleted=Your offer with ID ''{0}'' has been taken.
notification.bsqSwap.confirmed.headline=BSQ swap transaction confirmed
Expand Down
Expand Up @@ -146,27 +146,23 @@ private void handleTradeCompleted() {
private void openTradeFeedbackWindow() {
String key = "feedbackPopupAfterTrade";
if (!DevEnv.isDevMode() && preferences.showAgain(key)) {
UserThread.runAfter(() -> {
new TradeFeedbackWindow()
.dontShowAgainId(key)
.onAction(this::showNavigateToClosedTradesViewPopup)
.show();
}, 500, TimeUnit.MILLISECONDS);
UserThread.runAfter(() -> new TradeFeedbackWindow()
.dontShowAgainId(key)
.onAction(this::showNavigateToClosedTradesViewPopup)
.show(), 500, TimeUnit.MILLISECONDS);
} else {
showNavigateToClosedTradesViewPopup();
}
}

private void showNavigateToClosedTradesViewPopup() {
if (!DevEnv.isDevMode()) {
UserThread.runAfter(() -> {
new Popup().headLine(Res.get("portfolio.pending.step5_buyer.withdrawalCompleted.headline"))
.feedback(Res.get("portfolio.pending.step5_buyer.withdrawalCompleted.msg"))
.actionButtonTextWithGoTo("navigation.portfolio.closedTrades")
.onAction(() -> model.dataModel.navigation.navigateTo(MainView.class, PortfolioView.class, ClosedTradesView.class))
.dontShowAgainId("tradeCompleteWithdrawCompletedInfo")
.show();
}, 500, TimeUnit.MILLISECONDS);
UserThread.runAfter(() -> new Popup().headLine(Res.get("portfolio.pending.step5_buyer.tradeCompleted.headline"))
.feedback(Res.get("portfolio.pending.step5_buyer.tradeCompleted.msg"))
.actionButtonTextWithGoTo("navigation.portfolio.closedTrades")
.onAction(() -> model.dataModel.navigation.navigateTo(MainView.class, PortfolioView.class, ClosedTradesView.class))
.dontShowAgainId("tradeCompleteWithdrawCompletedInfo")
.show(), 500, TimeUnit.MILLISECONDS);
}
}

Expand Down