Skip to content

Commit

Permalink
Merge pull request #4396 from ripcurlx/only-show-signing-state-when-n…
Browse files Browse the repository at this point in the history
…eeded

Only show signing state if signing for payment method is required
  • Loading branch information
sqrrm authored Aug 3, 2020
2 parents 02b483f + a2302b3 commit 0931792
Showing 1 changed file with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1153,19 +1153,20 @@ public void updateItem(final OfferBookListItem item, boolean empty) {
String info;
String timeSinceSigning;

if (accountAgeWitnessService.hasSignedWitness(item.getOffer())) {
AccountAgeWitnessService.SignState signState = accountAgeWitnessService.getSignState(item.getOffer());
icon = GUIUtil.getIconForSignState(signState);
info = Res.get("offerbook.timeSinceSigning.info",
signState.getPresentation());
long daysSinceSigning = TimeUnit.MILLISECONDS.toDays(
accountAgeWitnessService.getWitnessSignAge(item.getOffer(), new Date()));
timeSinceSigning = Res.get("offerbook.timeSinceSigning.daysSinceSigning",
daysSinceSigning);
} else {
boolean needsSigning = PaymentMethod.hasChargebackRisk(
item.getOffer().getPaymentMethod(), item.getOffer().getCurrencyCode());
if (needsSigning) {
boolean needsSigning = PaymentMethod.hasChargebackRisk(
item.getOffer().getPaymentMethod(), item.getOffer().getCurrencyCode());

if (needsSigning) {
if (accountAgeWitnessService.hasSignedWitness(item.getOffer())) {
AccountAgeWitnessService.SignState signState = accountAgeWitnessService.getSignState(item.getOffer());
icon = GUIUtil.getIconForSignState(signState);
info = Res.get("offerbook.timeSinceSigning.info",
signState.getPresentation());
long daysSinceSigning = TimeUnit.MILLISECONDS.toDays(
accountAgeWitnessService.getWitnessSignAge(item.getOffer(), new Date()));
timeSinceSigning = Res.get("offerbook.timeSinceSigning.daysSinceSigning",
daysSinceSigning);
} else {
AccountAgeWitnessService.SignState signState = accountAgeWitnessService.getSignState(item.getOffer());

icon = GUIUtil.getIconForSignState(signState);
Expand All @@ -1180,11 +1181,12 @@ public void updateItem(final OfferBookListItem item, boolean empty) {
info = Res.get("shared.notSigned");
timeSinceSigning = Res.get("offerbook.timeSinceSigning.notSigned");
}
} else {
icon = MaterialDesignIcon.INFORMATION_OUTLINE;
info = Res.get("shared.notSigned.noNeed");
timeSinceSigning = Res.get("offerbook.timeSinceSigning.notSigned.noNeed");
}

} else {
icon = MaterialDesignIcon.INFORMATION_OUTLINE;
info = Res.get("shared.notSigned.noNeed");
timeSinceSigning = Res.get("offerbook.timeSinceSigning.notSigned.noNeed");
}

InfoAutoTooltipLabel label = new InfoAutoTooltipLabel(timeSinceSigning, icon, ContentDisplay.RIGHT, info);
Expand Down

0 comments on commit 0931792

Please sign in to comment.