Skip to content

Commit

Permalink
Update currency related fields after switch of payment account
Browse files Browse the repository at this point in the history
  • Loading branch information
ripcurlx committed Mar 9, 2022
1 parent 43fb646 commit 00dc799
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,16 +558,18 @@ protected void onPaymentAccountsComboBoxSelected() {
currencySelection.setVisible(paymentAccount.hasMultipleCurrencies());
currencySelection.setManaged(paymentAccount.hasMultipleCurrencies());
currencyTextFieldBox.setVisible(!paymentAccount.hasMultipleCurrencies());

model.onPaymentAccountSelected(paymentAccount);
model.onCurrencySelected(model.getTradeCurrency());

if (paymentAccount.hasMultipleCurrencies()) {
final List<TradeCurrency> tradeCurrencies = paymentAccount.getTradeCurrencies();
currencyComboBox.setItems(FXCollections.observableArrayList(tradeCurrencies));
model.onPaymentAccountSelected(paymentAccount);
currencyComboBox.getSelectionModel().select(model.getTradeCurrency());
} else {
TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency();
if (singleTradeCurrency != null)
currencyTextField.setText(singleTradeCurrency.getNameAndCode());
model.onPaymentAccountSelected(paymentAccount);
model.onCurrencySelected(model.getDataModel().getTradeCurrency());
}
} else {
currencySelection.setVisible(false);
Expand Down

0 comments on commit 00dc799

Please sign in to comment.