Skip to content

Commit

Permalink
Only show signing state if signing for payment method is required
Browse files Browse the repository at this point in the history
  • Loading branch information
ripcurlx committed Aug 3, 2020
1 parent 02b483f commit a2302b3
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 a2302b3

Please sign in to comment.