<p></p>
<p><b>@KaiWitt</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/bisq-network/bisq/pull/5501#discussion_r646391252">core/src/main/java/bisq/core/locale/CurrencyUtil.java</a>:</p>
<pre style='color:#555'>> + List<TradeCurrency> currencies = new ArrayList<>(Arrays.asList(
+ new FiatCurrency("EUR"),
+ new FiatCurrency("BRL"),
+ new FiatCurrency("GBP"),
+ new FiatCurrency("USD")
+ ));
+ currencies.sort(Comparator.comparing(TradeCurrency::getCode));
+ return currencies;
</pre>
<p>Sorting is not necessary when you initialize it in the correct order</p>
⬇️ Suggested change
<pre style="color: #555">- List<TradeCurrency> currencies = new ArrayList<>(Arrays.asList(
- new FiatCurrency("EUR"),
- new FiatCurrency("BRL"),
- new FiatCurrency("GBP"),
- new FiatCurrency("USD")
- ));
- currencies.sort(Comparator.comparing(TradeCurrency::getCode));
- return currencies;
+ return new ArrayList<>(Arrays.asList(
+ new FiatCurrency("BRL"),
+ new FiatCurrency("EUR"),
+ new FiatCurrency("GBP"),
+ new FiatCurrency("USD")
+ ));
</pre>
<hr>
<p>In <a href="https://github.com/bisq-network/bisq/pull/5501#discussion_r646395381">desktop/src/main/java/bisq/desktop/components/paymentmethods/CapitualForm.java</a>:</p>
<pre style='color:#555'>> + CurrencyUtil.getAllCapitualCurrencies().stream().forEach(e ->
+ fillUpFlowPaneWithCurrencies(isEditable, flowPane, e, capitualAccount));
</pre>
<p>You can use <code>forEach</code> on the list itself</p>
⬇️ Suggested change
<pre style="color: #555">- CurrencyUtil.getAllCapitualCurrencies().stream().forEach(e ->
- fillUpFlowPaneWithCurrencies(isEditable, flowPane, e, capitualAccount));
+ CurrencyUtil.getAllCapitualCurrencies().forEach(e ->
+ fillUpFlowPaneWithCurrencies(isEditable, flowPane, e, capitualAccount));
</pre>
<hr>
<p>In <a href="https://github.com/bisq-network/bisq/pull/5501#discussion_r646399820">desktop/src/main/java/bisq/desktop/components/paymentmethods/CapitualForm.java</a>:</p>
<pre style='color:#555'>> + gridRowFrom = gridRow;
+ addCompactTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
+ capitualAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
+ addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
+ Res.get(capitualAccount.getPaymentMethod().getId()));
+ addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.capitual.cap"),
+ capitualAccount.getAccountNr());
+ addLimitations(true);
+ addCurrenciesGrid(false);
+ }
+
+ @Override
+ public void updateAllInputsValid() {
+ allInputsValid.set(isAccountNameValid()
+ && capitualValidator.validate(capitualAccount.getAccountNr()).isValid
+ && capitualAccount.getTradeCurrencies().size() > 0);
</pre>
⬇️ Suggested change
<pre style="color: #555">- && capitualAccount.getTradeCurrencies().size() > 0);
+ && !capitualAccount.getTradeCurrencies().isEmpty());
</pre>
<p>It's faster and makes your intent clearer</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/5501#pullrequestreview-677146944">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNWKAMASEQ4GN6UCHXDTRSDONANCNFSM45ADEVQA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNXRW6IEHPRGFK5O2ELTRSDONA5CNFSM45ADEVQKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOFBOHCQA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/5501#pullrequestreview-677146944",
"url": "https://github.com/bisq-network/bisq/pull/5501#pullrequestreview-677146944",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>