Skip to content

Commit

Permalink
Improve wording of trade completed notification popups
Browse files Browse the repository at this point in the history
  • Loading branch information
ripcurlx committed Jan 11, 2022
1 parent 9759ceb commit 4a3e29d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
9 changes: 5 additions & 4 deletions core/src/main/java/bisq/core/trade/TradeManager.java
Original file line number Diff line number Diff line change
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
6 changes: 3 additions & 3 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,8 @@ 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.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 @@ -3135,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
Original file line number Diff line number Diff line change
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

0 comments on commit 4a3e29d

Please sign in to comment.