[bisq-network/bisq] Display "Payment Method" column in Open Offers view (#4193)

dmos62 notifications at github.com
Thu May 14 14:29:52 UTC 2020


@dmos62 requested changes on this pull request.

NACK due to a couple minor things. Haven't tested.

> @@ -116,6 +118,10 @@ public void initialize() {
         priceColumn.setComparator(Comparator.comparing(o -> o.getOffer().getPrice(), Comparator.nullsFirst(Comparator.naturalOrder())));
         volumeColumn.setComparator(Comparator.comparing(o -> o.getOffer().getVolume(), Comparator.nullsFirst(Comparator.naturalOrder())));
         dateColumn.setComparator(Comparator.comparing(o -> o.getOffer().getDate()));
+        paymentMethodColumn.setComparator(Comparator.comparing(
+                o -> o.getOffer() != null ? o.getOffer().getPaymentMethod().getId() : null,

Is the null check necessary? The above calls to result of `o.getOffer()` don't null check.

> @@ -19,6 +19,7 @@
 
 import bisq.desktop.common.model.ActivatableWithDataModel;
 import bisq.desktop.common.model.ViewModel;
+import bisq.desktop.main.portfolio.pendingtrades.PendingTradesListItem;

Unused import.

> @@ -118,6 +121,23 @@ String getMarketLabel(OpenOfferListItem item) {
         return CurrencyUtil.getCurrencyPair(item.getOffer().getCurrencyCode());
     }
 
+    String getPaymentMethod(OpenOfferListItem item) {
+        String result = "";
+        if (item != null) {
+            Offer offer = item.getOffer();
+            checkNotNull(offer);
+            checkNotNull(offer.getPaymentMethod());
+            String method = Res.get(offer.getPaymentMethod().getId() + "_SHORT");

Can we guarantee that `Res.get(paymentMethod.getId() + "_SHORT")` will always find the translation? If unsure, should wrap in try-catch.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4193#pullrequestreview-411849532
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200514/8264ceb8/attachment.html>


More information about the bisq-github mailing list