mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Remove 'monero:' prefix when adding a XMR account
Some wallets copy the address with a 'monero:' prefix. If user pastes that directly into the form he gets a validation error. We remove now that prefix so the input is automatically adjusted to the address only.
This commit is contained in:
parent
57bed13cf8
commit
9a57525a46
1 changed files with 8 additions and 0 deletions
|
@ -38,6 +38,7 @@ import bisq.core.payment.validation.AltCoinAddressValidator;
|
|||
import bisq.core.util.coin.CoinFormatter;
|
||||
import bisq.core.util.validation.InputValidator;
|
||||
|
||||
import bisq.common.UserThread;
|
||||
import bisq.common.util.Tuple3;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
@ -123,6 +124,13 @@ public class AssetsForm extends PaymentMethodForm {
|
|||
addressInputTextField.setValidator(altCoinAddressValidator);
|
||||
|
||||
addressInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||
if (newValue.startsWith("monero:")) {
|
||||
UserThread.execute(() -> {
|
||||
String addressWithoutPrefix = newValue.replace("monero:", "");
|
||||
addressInputTextField.setText(addressWithoutPrefix);
|
||||
});
|
||||
return;
|
||||
}
|
||||
assetAccount.setAddress(newValue);
|
||||
updateFromInputs();
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue