From 0a606b43358a392514bd22eda0cc479e930931d9 Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Tue, 10 Sep 2019 12:28:09 -0700 Subject: [PATCH] Hide account age verification salt for altcoin accounts The salt for account age verification is not relevant for altcoins, so hide the field. Fixes https://github.com/bisq-network/bisq/issues/2537 --- .../paymentmethods/PaymentMethodForm.java | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java index 2f962975e7d..42b2b922142 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java @@ -189,27 +189,29 @@ else if (!paymentAccount.getTradeCurrencies().isEmpty()) else addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.limitations"), limitationsText); - if (isAddAccountScreen) { - InputTextField inputTextField = addInputTextField(gridPane, ++gridRow, Res.get("payment.salt"), 0); - inputTextField.setText(Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt())); - inputTextField.textProperty().addListener((observable, oldValue, newValue) -> { - if (!newValue.isEmpty()) { - try { - // test if input is hex - Utilities.decodeFromHex(newValue); - - paymentAccount.setSaltAsHex(newValue); - } catch (Throwable t) { - new Popup().warning(Res.get("payment.error.noHexSalt")).show(); - inputTextField.setText(Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt())); - log.warn(t.toString()); + if (!(paymentAccount instanceof AssetAccount)) { + if (isAddAccountScreen) { + InputTextField inputTextField = addInputTextField(gridPane, ++gridRow, Res.get("payment.salt"), 0); + inputTextField.setText(Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt())); + inputTextField.textProperty().addListener((observable, oldValue, newValue) -> { + if (!newValue.isEmpty()) { + try { + // test if input is hex + Utilities.decodeFromHex(newValue); + + paymentAccount.setSaltAsHex(newValue); + } catch (Throwable t) { + new Popup().warning(Res.get("payment.error.noHexSalt")).show(); + inputTextField.setText(Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt())); + log.warn(t.toString()); + } } - } - }); - } else { - addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.salt", - Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt())), - Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt())); + }); + } else { + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.salt", + Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt())), + Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt())); + } } }