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

[1.2.0] Addresses issues in peer info popup #3496

Merged
merged 1 commit into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions desktop/src/main/java/bisq/desktop/components/PeerInfoIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,19 @@ private PeerInfoIcon(NodeAddress nodeAddress,
getChildren().addAll(outerBackground, innerBackground, avatarImageView, tagPane, numTradesPane);

boolean needsSigning = PaymentMethod.hasChargebackRisk(offer.getPaymentMethod(), offer.getCurrencyCode());
String accountSigningState = Res.get("shared.notSigned.noNeed");
String accountSigningState = null;
String accountAgeInfo = peersAccount.second;

if (needsSigning) {
accountSigningState = StringUtils.capitalize(accountAgeWitnessService.getSignState(offer).getPresentation());
AccountAgeWitnessService.SignState signState = accountAgeWitnessService.getSignState(offer);
accountSigningState = StringUtils.capitalize(signState.getPresentation());

if (signState.equals(AccountAgeWitnessService.SignState.UNSIGNED))
accountAgeInfo = null;
}

addMouseListener(numTrades, privateNotificationManager, offer, preferences, formatter, useDevPrivilegeKeys,
isFiatCurrency, peersAccount.first, peersAccount.second, accountSigningState);
isFiatCurrency, peersAccount.first, accountAgeInfo, accountSigningState);
}

private Tuple2<Long, String> getPeersAccountAge(@Nullable Trade trade, @Nullable Offer offer) {
Expand Down Expand Up @@ -285,7 +291,8 @@ protected void addMouseListener(int numTrades,
long makersAccountAge,
String makersAccountAgeInfo,
String accountSigningState) {
final String accountAgeTagEditor = isFiatCurrency ?

final String accountAgeTagEditor = isFiatCurrency && makersAccountAgeInfo != null ?
makersAccountAge > -1 ?
DisplayUtils.formatAccountAge(makersAccountAge) :
Res.get("peerInfo.unknownAge") :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,15 @@ private void addContent() {
GridPane.setColumnSpan(addCompactTopLabelTextField(gridPane, ++rowIndex,
Res.get("peerInfo.nrOfTrades"),
numTrades > 0 ? String.valueOf(numTrades) : Res.get("peerInfo.notTradedYet")).third, 2);
if (accountAge != null) {
GridPane.setColumnSpan(addCompactTopLabelTextField(gridPane, ++rowIndex, accountAgeInfo, accountAge).third, 2);
}

if (accountSigningState != null) {
GridPane.setColumnSpan(addCompactTopLabelTextField(gridPane, ++rowIndex, Res.get("shared.accountSigningState"), accountSigningState).third, 2);
}

if (accountAge != null) {
GridPane.setColumnSpan(addCompactTopLabelTextField(gridPane, ++rowIndex, accountAgeInfo, accountAge).third, 2);
}

inputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("peerInfo.setTag"));
GridPane.setColumnSpan(inputTextField, 2);
Map<String, String> peerTagMap = preferences.getPeerTagMap();
Expand Down